css
БесплатноБез исполняемых скриптовНе проверенUSE WHEN writing, fixing or reviewing plain CSS or Sass for a web page, even a one-line change, including a rule that loses to another, a third-party…
от mintuz★ 38 звёзд на GitHubОб этом скилле
CSS
Before you edit
- Read the stylesheets the change touches, the custom-property scale, the utilities, and any README rule about load order or files you must not edit.
- If the person asks for a review or findings, report and change nothing
(
principle-investigate-read-only). If the request covers all stylesheets, state which files and selectors you covered and which you left out (principle-state-the-scope). - Take sizes and colours from the custom-property scale. If the request names a pixel value, use
the step that equals it. Add a step to the scale only when none fits. Never put a raw number in
a component (
principle-reuse-before-building,principle-derive-from-one-owner). If the project has no scale, write the value inremand do not create a scale.
When a rule loses to another
Read cascade.md before you write !important, touch an ID selector, or
work around a third-party stylesheet.
- Style with classes only. Use no ID selectors, no element-qualified classes (
ul.nav) and no nesting four or more levels deep. - Fix a conflict in this order. Stop at the first that works: source order; your own selectors
(simplify the rule you own, or self-chain
.btn.btn); cascade layers, only when every competing rule can enter the layer order. - If the winning rule is in a stylesheet you cannot edit, and its load order and markup cannot
change, write one
!importanton the single losing property, on your own class. Change no other file. Beside it, add a comment that names the boundary and says when to remove the!important(for example, when the provider drops or changes its rule). Do not copy the foreign ID selector. If the foreign declaration is itself!important, put yours in a cascade layer instead. - If you find a reactive
!importantin code you own, make the rule win another way, then delete the!important(principle-fix-root-causes). Keep the proactive!importantonu-utilities. - In the explanation, say why the other rule won (for example, its ID outranks your class) and why yours now wins. For the boundary exception, say that an important declaration beats a normal one whatever its specificity or source order. Name the fixed stylesheet, load order and markup as the reason for the exception.
Units
Read units-and-spacing.md when you choose a unit.
- Use
remor a scale step forfont-size, spacing between blocks of text, padding around text in a control, and media queries:@media (min-width: 48rem), not768px. - Use
pxfor borders,border-radiusand shadows. - Write
line-heightwithout a unit. Never sethtml { font-size: 62.5%; }. - In the explanation, say that
pxfont sizes ignore the reader's text-size setting andremfollows it, and that a unitless line height multiplies each element's own font size.
Spacing between components
- A component sets no margin outside its own box. The parent owns the space:
gapon a grid or flex parent, or a stack rule.stack > * + * { margin-block-start: … }. - If a component has an outer margin, delete the declaration. Do not set it to
0, add a:last-childreset, or add a context override such as.sidebar .card { margin-bottom: 0; }(principle-subtract-before-you-add). - In the explanation, name the cause of each spacing problem, for example a parent with no
gapor a component's own outer margin.
Shorthands
- Use the longhand to set one value:
background-color, notbackground. Use a shorthand only when you mean every value it sets. - If a shorthand has wiped a value, replace the shorthand with the longhands you meant. Do not
re-declare the lost value after it. Do not fold the lost value into the shorthand
(
principle-fix-root-causes). - In the explanation, name the properties the shorthand reset. Say that a shorthand resets every property it covers but does not name to its initial value.
Hidden content and focus
Read patterns.md before you hide anything or style focus.
- Hide permanently hidden text with the
.u-sr-onlyutility. Never put it on an element that can receive focus. - A control that appears on focus, such as a skip link, is a stateful component with no
!important:- Hide it by clipping it to 1px (
clip-path: inset(50%)). Never usedisplay: none,visibility: hidden, or off-screen coordinates such astop: -40pxortranslateY(-100%). - In its focus rule, restore every hiding property and show an
outline, not only abox-shadow. - In its focus rule, bound its width to the viewport (
max-inline-size: calc(100vw - 2rem)), so it fits a 320 CSS px viewport at 400% zoom. - Give it system colours in a
@media (forced-colors: active)rule.
- Hide it by clipping it to 1px (
- Keep a contrast ratio of at least 4.5:1 for text, and 3:1 for large text, control boundaries and focus indicators.
New classes
Read [patterns
Установить css в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл css?
USE WHEN writing, fixing or reviewing plain CSS or Sass for a web page, even a one-line change, including a rule that loses to another, a third-party stylesheet you cannot edit, units, spacing between components, shorthands, skip links, hidden and focus styles, or deleting styles that look unused; NOT WHEN the project uses Tailwind (tailwind.config.js, utility classes, CVA variants, Tailwind theme tokens); produces CSS that wins the cascade without ID selectors or reactive !important, scales with the reader's text size, keeps spacing in the parent and deletes styles only on evidence.
Как установить скилл css?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл css запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
от Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
от Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
от Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
от Anthropic