agentsclimarketplace

Avoid arbitrary values in tailwind classes

Skill mew-ton/coding-guidelines/skills/avoid-arbitrary-values-in-tailwind-classes

Prohibits Tailwind arbitrary values (e.g. w-[17px]) to enforce design system token consistency. Use when writing or reviewing Tailwind class lists. Do not use when a value is intentionally one-off and cannot be expressed by any existing token (e.g. a pixel-perfect third-party embed constraint).From its SKILL.md

Install
npx -y skills add mew-ton/coding-guidelines --skill avoid-arbitrary-values-in-tailwind-classes

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

2 things to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
  • 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

SKILL.md

1.6 KB, as published. Nobody here has run it

Summary

Avoid using arbitrary value syntax (square brackets like w-[17px], bg-[#f00]) unless absolutely necessary. Stick to the defined design system theme tokens.

Rationale

  • Consistency: Using standard tokens (e.g. w-4, p-2) ensures visual consistency across the application.
  • Maintainability: Magic numbers scattered in code are hard to update. Updating the theme config propagates changes everywhere.
  • Readability: h-[3.75rem] is harder to parse and reason about than h-15 (if 15 is defined) or standard spacing.

Guidance

  1. Check Theme First: Always look for an existing utility class that is "close enough".
  2. Extend Config: If a value is used repeatedly (more than twice), add it to tailwind.config.js.
  3. One-offs: Arbitrary values are permissible ONLY for truly unique, pixel-perfect requirements (e.g. top-[33%]) that will never be reused, but treat these as code smells to be challenged.

Examples

Bad

<div class="w-[17px] h-[13px] mt-[5px]"></div>

Good

<!-- Use closest standard spacing -->
<div class="w-4 h-3 mt-1"></div>

Keep looking

Skills are one crate of 607,721. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.