agentleFS
SantosAlarconSantosAlarcon/css-best-practices/skills/SKILL.md

css-best-practices

Skill0 starsChanged 5 months agoMITView on GitHub

Skills for CSS3 best practices

1 other project uses a version of this.

Adopted by

Most recently taken up by

  • Other versions1 project uses a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 1

    1. ZHOUKAILIAN/skills★ 1same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

The file

We split this skill into the rules it gives an agent

10 rules. About 0 are common, 9 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈9

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use this skill when writing CSS files if the user defines it for the project

    line 10
  2. Distinctive:

    Instead of putting all the styles in one file, it is better to create a "styles" folder, and then create a CSS file for every …

    line 13
  3. Distinctive:

    Use CSS variables when defining the design system and later use them in its corresponding selector/classes using var(<variable>).

    line 14
  4. Distinctive:

    When defining light and dark mode, use the light-dark() function.

    line 16
  5. Distinctive:

    When using selectors or children/brother nodes, use native CSS nesting, putting the "&" following the selector inside the parent …

    line 17
  6. Distinctive:

    When defining background and foreground colors, make sure that the colors have AAA contrast color to fulfill accesibility requirements.

    line 21
  7. Distinctive:

    When writing responsive media queries, use the clamp() function to adapt the text size in tablets and mobile devices.

    line 22
  8. Distinctive:

    If a project has presence of modals, make the background blurry, darker and unscrollable when the modal is on.

    line 23
  9. Distinctive:

    If the project uses a variable font, use the "font-variation-settings" to define the font weight depending on the contrast setting.

    line 24
  10. Very specific:

    If you use the grid on a component or part of the page which has cards/posters/etc..., use the auto-fill thing to make the grid adapt …

    line 27

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

css-best-practices

This skill consists in writing CSS styles using the latest CSS3 features

When to use

Use this skill when writing CSS files if the user defines it for the project

Instructions

  1. Instead of putting all the styles in one file, it is better to create a "styles" folder, and then create a CSS file for every component/part of the project
  2. Use CSS variables when defining the design system and later use them in its corresponding selector/classes using var(<variable>).
  3. Take into consideration good UX/UI practices when defining styles to avoid later issues.
  4. When defining light and dark mode, use the light-dark() function. For example: light-dark(<light color>,<dark color>).
  5. When using selectors or children/brother nodes, use native CSS nesting, putting the "&" following the selector inside the parent class/selector.
  6. Take as a high priority to make the responsive thing: mobile, tablet and desktop. Always use the "@media (width < <width in px>)".
  7. In the global style file, write a "reset CSS" to bypass the browser default styles to avoid styling problems.
  8. Also, in the same file, divide every set of styles with layers usign "@layer <layer name>", and inside put the classes corresponding that set.
  9. When defining background and foreground colors, make sure that the colors have AAA contrast color to fulfill accesibility requirements.
  10. When writing responsive media queries, use the clamp() function to adapt the text size in tablets and mobile devices.
  11. If a project has presence of modals, make the background blurry, darker and unscrollable when the modal is on. It would be better if the modal has open/exit animations.
  12. If the project uses a variable font, use the "font-variation-settings" to define the font weight depending on the contrast setting. Use the "@media (prefers-contrast)" queries when defining those settings.
  13. Try to use the rem/vw/vh units instead of px when possible.
  14. Control the size of the elements when defining the responsive styles, with the purpose of looking fine in responsive media queries and with user experience.
  15. If you use the grid on a component or part of the page which has cards/posters/etc..., use the auto-fill thing to make the grid adapt itself in every device.

About CSS Nestings

You have to write the CSS nesting like this example:

.class {
    &:hover {
        ...
    }

    &::after {
        ...
    }

    & > descendent child {
        ...
    }
}

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.