The skill that teaches AI agents to write Stylecheat, shown as it is: SKILL.md first, then its four reference files.
Classless/hybrid CSS component library. Docs: https://stylecheat.korte.kim/ | Downloads: https://stylecheat.korte.kim/download
First time in a project without stylecheat: ask which variant to use:
<crow>, button[primary]).button.primary)https://stylecheat.korte.kim/download/class-less/stylecheat.csshttps://stylecheat.korte.kim/download/class-based/stylecheat.csshttps://stylecheat.korte.kim/download/hybrid/stylecheat.cssEach folder also has stylecheat-stable.css, which leaves out ChromeOnlyModifiers.css.
Every build scopes its styles under .stylecheat, [stylecheat] - mark the element that should get Stylecheat, usually <body>:
Both forms work in every build. Without one of them, no component styles will apply.
--unit: 4px - all spacing uses calc(var(--unit) * N)
Conversion rule: Values ≤32px (N ≤ 8) use units. Larger values stay as literal px.
sm, md, lg on any element set --unit and --unit-size, which children inherit:
| Attr | --unit | --unit-size |
|---|---|---|
sm | 2.67px | 12px |
md | 4px | 16px |
lg | 5.33px | 21.33px |
sm never sets text below 12px. lg scales with the parent's font size (values shown at 16px). On buttons, selects and text inputs, sm and lg change --unit only, so the control gets shorter or taller while its text keeps its size.
When choosing between block, grid, or flex, prioritize flex.
Always use theme variables for dark/light mode support. The full list is in references/theming.md.
Icons use attribute syntax:
For icons beyond the built-in ones, download them as icon CSS in the same icon[name] format.
Gap, margin, padding — g-1 to g-8 (plus g-10, g-12, g-16), p-1 to p-8, m-1 to m-8, plus directional variants (mt-, mb-, ml-, mr-, mx-, my-, px-, py-, pt-, pb-, pl-, pr-). Negative margins take a double dash: mt--4, mx--2:
Flex and size modifiers are in references/layout.md.
bg-* uses 20% opacity: oklch(from var(--color) l c h / 0.2)
Breakpoints: sm (≤768px), md (768–1024px), lg (>1024px)
Available responsive modifiers: sm:hide, sm:flex, sm:block, sm:vertical, sm:order-first, sm:sm, sm:md, sm:lg, and every flex, gap, size and spacing modifier — sm:f-1, sm:g-4, sm:w-full, sm:h-0, sm:max-w-96, sm:p-4, sm:px-0, sm:mx--4 (and md:*, lg:* equivalents). sm:vertical switches a <crow> to flex-direction: column on mobile. Carousels switch axis on mobile with sm:x, sm:y or sm:z on <slides>.
Flexbox layout component. Default: display: flex; align-items: center; justify-content: center.
| Attribute | Effect |
|---|---|
left | justify-content: flex-start |
right | justify-content: flex-end |
| (none) | justify-content: center |
| Attribute | Effect |
|---|---|
up | align-items: flex-start + height: 100% |
down | align-items: flex-end + height: 100% |
| (none) | align-items: center |
Add vertical to stack items in a column:
In vertical mode, up/down swap to justify-content and left/right swap to align-items.
Use f-1 through f-8 to set flex ratios, f-0 for flex: none:
Sizes run 0–8, then 10, 12, 16, 18, 20, 24, 32, 36, 40, 48, 60, 64, 72, 96, 128 and 160.
Typed w/h attributes multiply by --unit (Chrome 133+):
Breakpoints: sm (≤768px), md (768–1024px), lg (>1024px)
Available per breakpoint: hide, flex, block, vertical, order-first, sm, md, lg, plus every flex, gap, size and spacing modifier (sm:f-1, sm:g-4, sm:w-full, sm:p-4, sm:mx--4)
Example: sm:vertical switches a <crow> to flex-direction: column on mobile.
Variant is mandatory onbuttonanda. Stylecheat only styles these elements when they carry a variant:primary,secondary, ortertiaryon buttons,primaryorsecondaryon links (selector:a:is([primary],[secondary])). A bare<button>/<a href>matches nothing in Stylecheat and falls back to raw browser defaults (a bare link renders blue and underlined, which always reads as a bug) — there is no such thing as a "plain Stylecheat link/button". Always pick a variant; when emphasis is unclear, default tosecondary.
Three variants: primary, secondary, tertiary. Default to secondary when adding new buttons.
Icon goes directly inside — no crow wrapper needed (line-height: 1em):
primary/secondary are inline text links (accent vs. muted). For inline links in body text, default to primary. When writing or reviewing markup, treat a variant-less <a> as an error and fix it (custom-styled exceptions like a logo link need their own selector).
A link that should look like a button needs class="button" plus a button variant — that combination is what gives an <a> the button styling:
Pill-shaped label. Default variant uses --primary. Combine bg-* + text-* for color variants:
Container with border, padding, and theme colors:
Card has built-in padding, so there's no need to add p-*.
Expandable content via CSS grid animation. Toggle open attribute to expand:
Icon flip on open — CSS only via :has():
class-based: .accordion, .accordion.open, .accordion-content
Full-size scroll container. Wrap in <carousel>, then use <slides> with an axis attribute:
<slides> attr | Behaviour |
|---|---|
x | Horizontal scroll-snap |
y | Vertical scroll-snap |
z | Z-axis fade/scale transition (scroll-driven animation) |
sm:x / sm:y / sm:z | Switch axis at ≤768px, e.g. <slides z sm:y> — z's pinned slides can't be swiped on touch screens, so give phones y |
scrollbar | Show scrollbar (hidden by default) |
<slide> is the snap target; content goes inside it. Carousel sets container-type: size.
All children occupy the same grid cell — layered on top of each other:
Circular element. Size via a size modifier (or the typed w="N" attr, if the project is using ChromeOnlyModifiers.css):
width: 100%; aspect-ratio: 1; border-radius: 100%
Full-width fading divider line:
Gradient from transparent → --border → transparent.
Background grid pattern for design/layout previews. --grid-size defaults to calc(var(--unit) * 12):
[locked] fixes the grid position; without it the grid scrolls with content. When used on <slides grid> with x/y/z, the grid animates to match scroll position.
Styled automatically for all text-like input types (text, email, password, number).
Toggle switch — checkbox with role="switch":
Toggle with .dark class on a parent element (typically html or body):
All colors use OKLCH format for consistent manipulation:
| Variable | Light | Dark | Usage |
|---|---|---|---|
--background | Light gray | Dark blue | Page background |
--foreground | Dark gray | Light gray | Text color |
--primary | Orange | Orange | Primary actions |
--secondary | Light gray | Dark gray | Secondary elements |
--muted | Very light | Dark | Subdued backgrounds |
--accent | Light blue | Dark blue | Highlights |
--destructive | Red | Red | Delete/danger actions |
Each color has a -foreground variant for text on that background.
--card, --card-foreground - Card backgrounds--popover, --popover-foreground - Dropdowns, tooltips--border - Border color--input - Form input backgrounds--ring - Focus ringsSeparate variables for sidebar theming:
--sidebar, --sidebar-foreground--sidebar-primary, --sidebar-accent--sidebar-border, --sidebar-ringUse oklch(from var(...)) for color variants:
Override variables in your CSS:
Visual heading styles (size, color, weight) apply globally. Sibling spacing requires a [typography] or .typography wrapper — use the <typography> custom element:
Spacing is automatic inside the wrapper — no manual margin classes needed for prose.
All headings: font-weight: 600, color: var(--primary)
| Element | Size | Line-height |
|---|---|---|
h1 | calc(var(--unit) * 10) = 40px | calc(var(--unit) * 12) |
h2 | calc(var(--unit) * 7) = 28px | calc(var(--unit) * 8) |
h3 | calc(var(--unit) * 6) = 24px | calc(var(--unit) * 8) |
h4 | calc(var(--unit) * 5) = 20px | calc(var(--unit) * 8) |
h5 | calc(var(--unit) * 4) = 16px | calc(var(--unit) * 4) |
h6 | calc(var(--unit) * 3.5) = 14px | calc(var(--unit) * 4) |
Class equivalents: .h1 through .h6
Paragraphs: line-height: 1.6, no default margins.
padding-inline-start: calc(var(--unit) * 6) (24px)| Element | Styling |
|---|---|
code | Mono font, 14px, secondary background, rounded |
pre | Block code, 14px, padding, secondary background, rounded |
mark | Accent background |
small | calc(var(--unit) * 3.5) = 14px |
blockquote / quote | Left border, italic, muted color |
strong / b | font-weight: 600, slightly lighter foreground |
[typography])| Element | Margin-top on next sibling |
|---|---|
h1, h2 | calc(var(--unit) * 3) = 12px |
h3–h6 | calc(var(--unit) * 2) = 8px |
p | calc(var(--unit) * 3) = 12px |
ul, ol | calc(var(--unit) * 3) = 12px |
blockquote, quote, pre | calc(var(--unit) * 4) = 16px |
| Element | Margin-top |
|---|---|
* + h1 | calc(var(--unit) * 8) = 32px |
* + h2 | calc(var(--unit) * 7) = 28px |
* + h3 | calc(var(--unit) * 6) = 24px |
* + h4 | calc(var(--unit) * 5) = 20px |
* + h5, * + h6 | calc(var(--unit) * 4) = 16px |
hr + * and * + hr: calc(var(--unit) * 6) = 24px
v1.0.0