Skip to content

feat(stylelint-config): take values through tokens in strict and add flat-layers config - #220

Merged
dangreen merged 1 commit into
feat/oxlint-skill-rulesfrom
feat/stylelint-strict-flat-layers
Nov 25, 2026
Merged

dangreen merged 1 commit into
feat/oxlint-skill-rulesfrom
feat/stylelint-strict-flat-layers

Conversation

@dangreen

Copy link
Copy Markdown
Member

Stacked on #219.

strict is rewritten around tokens, and a new flat-layers config keeps each kind of style in the file Flat Layers Design gives it.

strict

  • One declaration-strict-value covers colors, fill, stroke, fonts, z-index, paddings, margins, gaps, insets, radii, font size, line height, outline and underline offsets, scroll padding and margin. Each takes a token, a calc of tokens, or a value that needs none, listed per property:
    • currentcolor, transparent and system colors for colors;
    • 0, 1, auto and percentages for lengths;
    • -2 to 2 for z-index, a local order, since the layers across components are tokens.
  • Colors: light-dark() only in custom properties, so a color reads a role.
  • No pulls: no negative margins, since a box stands where its box stands.
  • Overflow: the shorthand alone, no overflow-x, -y, -block or -inline. The logical autofix turns overflow-y into overflow-block, which Safari 18 drops.
  • Mixins: no composes, since a mixin is a class in the markup.
  • The root element (html, :root) keeps its scrollbar's room and its scroll anchoring: no overflow-anchor, scrollbar-gutter or overflow axes.
  • .root takes no inset, top, right, bottom, left or z-index, since where a block stands is its consumer's.
  • Name patterns for tokens and custom media move to flat-layers, since they name what its files hold. A project that relied on them in strict adds flat-layers, whose custom media are named --screen* where strict had --media*.

flat-layers

  • Tokens live in variables.css, typed by their name, as --colorText or --sizeSpace4, with the ui-component skill's types. Hex colors, color functions, cubic-bezier() and steps() are allowed there alone.
  • Media: media features and @custom-media only in media.css, and custom media named --screen*. Mixins may read prefers-color-scheme, for a picture drawn per theme.
  • Containers: container and container-name only in containers.module.css.
  • Global selectors: :global only as :global(html):has(. html, :root, body and data-theme only in the global files: styles.css, globals.css, variables.css and mixins.module.css.
  • !important only in mixins.

Base config

length-zero-no-unit leaves custom properties alone: 0px inside calc() is a length, and a bare 0 is not.

🤖 Generated with Claude Code

@dangreen
dangreen added this pull request to stack #222 November 25, 2026 17:13
@dangreen
dangreen merged commit fee88c9 into main Nov 25, 2026
6 checks passed
@dangreen
dangreen deleted the feat/stylelint-strict-flat-layers branch November 25, 2026 17:22
@github-actions github-actions Bot mentioned this pull request Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant