| version | alpha | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| name | mCSS | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| description | ITCSS-based CSS framework and documentation site with compact tokens, light/dark themes, and pragmatic component defaults. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| colors |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| typography |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| rounded |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| spacing |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| components |
|
mCSS is a utility-conscious CSS framework and documentation site with an ITCSS cascade, compact component classes, and design tokens stored as CSS custom properties. The visual identity is clean, technical, and documentation-first: blue interaction color, cool neutral surfaces, dense spacing, rounded-but-not-pill shapes, and system typography that keeps pages fast and readable.
The canonical token sources are src/styles/framework/settings.tokens.css for raw scales and src/styles/framework/settings.ui.css for semantic aliases and component defaults (interface tokens). This file translates those tokens into the DESIGN.md format for coding agents. When the CSS and this file disagree, the CSS source files win.
The palette has three jobs:
- Primary blue:
--primary-*drives links, primary buttons, progress, selected states, and documentation highlights. - Base neutrals:
--base-*handles text, borders, surfaces, dark mode surfaces, disabled states, and secondary metadata. - Feedback colors:
--yes-*,--no-*, and--maybe-*are reserved for success, danger, and warning states.
The live theme uses light-dark() heavily. In light mode, pages sit on --base-0 with --base-950 text. In dark mode, the body shifts to --base-950, text softens to --base-200, and links use --primary-400. Agents should preserve this dual-mode behavior instead of hard-coding a single foreground/background pair.
Use blue sparingly but confidently for interaction. Avoid adding unrelated accent palettes unless a feature truly needs a new semantic color.
Body copy uses a system sans stack: ui-sans-serif, system-ui, sans-serif. Headings use the display stack from --display, with heavy 900 weight and tight 1.15 line-height. Code uses the repo's long monospace stack and should retain the compact inline-code treatment from elements.text.css.
The type scale is modest and documentation-friendly:
- Small UI text:
--text-xsthrough--text-sm. - Body text:
--text-md. - Section and card headings:
--text-lg,--text-xl, and--display-sm. - Major headings:
--display-mdand above.
Headings should use balanced wrapping and avoid oversized marketing-style type unless the existing page already establishes that treatment.
Spacing is based on a 4px stepping scale with an 8px baseline. Prefer existing spacing tokens over one-off values. Common content gaps are --sm3 (24px) and --md3 (36px); compact controls use --xs2 (8px) and --xs3 (12px).
Layouts lean on three primitives:
.wrapfor constrained horizontal rhythm..gridfor responsive column systems..layout-*shells for centered and sidebar documentation pages.
Documentation content is usually constrained around 70ch to 77ch. Sidebar layouts expose navigation from the --md breakpoint upward and add a secondary TOC at --lg.
Breakpoints are hard-coded in settings.media-queries.css because CSS custom properties cannot be used inside media queries: xxs 240px, xs 360px, sm 480px, md 768px, lg 1024px, xl 1440px, xxl 1920px.
Depth is subtle and tokenized with --shadow-sm through --shadow-xxl. Shadows use --ui-shadow-color, which changes between light and dark mode. Cards can be plain, filled, or raised; raised cards increase shadow on hover.
Use shadows to distinguish actionable or layered surfaces, not as page-section decoration. Borders are often enough for quiet documentation UI.
The shape scale is intentionally small:
--radius-sm(3px) for inline code, small loading bars, and small affordances.--radius-md(5px) for tags, inputs, tables, and blockquotes.--radius-lg(8px) for buttons, cards, and notices.--radius-xl(12px) for larger buttons and hero media.--radius-roundfor avatars and circular controls.
Default components should feel crisp and slightly rounded, not bubbly. Prefer --radius-lg for new component containers unless the surrounding component family suggests otherwise.
Buttons use .button or .bt, with variants such as .bt-primary, .bt-outline, .bt-text, .bt-yes, .bt-no, and .bt-maybe. They are inline-flex, semi-bold, minimum 36px tall by default, and use a fast 100ms transition. Active buttons scale to 0.97.
Cards use .card with .card-filled and .card-raised variants. Keep internal spacing on --card-spacing and use .card_header, .card_media, .card_content, and .card_actions for composition.
Tags, notices, avatars, headers, footers, hero controls, and the read-progress bar all have semantic custom properties in settings.ui.css. When creating a new component, add interface tokens there before using raw scale values inside component CSS.
Class naming is BEM-like with mCSS separators: .block, .block_element, .block-modifier, and .is-* state classes composed inside the block.
Do preserve the native cascade-layer setup: framework files import into named layers (settings, base, elements, global, components, theme, helpers) via src/styles/framework/mcss.css; site-only files import unlayered via src/styles/_global.css.
Do add new CSS files with the correct layer prefix, such as component.name.css or help.name.css, then import them with layer(<name>) in framework/mcss.css (framework) or plainly in _global.css (site).
Do use semantic theme tokens when they exist. Raw palette tokens are fine for new semantic roles, but component CSS should converge on named component properties.
Do keep all formatting at 2 spaces (CSS, Astro, JS, TS), per .editorconfig.
Don't use page-specific CSS when a reusable component is the better fit.
Don't bypass dark mode by hard-coding light-only text, border, or surface colors.
Don't add helper utilities casually; the helper layer has high specificity and should remain a last resort.