# mCSS: full reference > mCSS is a modern CSS framework and component library for websites: real CSS, real markup, zero build step, built on native cascade layers. It is not a dependency; you copy the files into your project and own them. This file concatenates every docs and components page. A per-page index is at /llms.txt. # Marketing Template > Part of mCSS (mcss.dev). Rendered page: https://mcss.dev/docs/template A complete marketing one-pager built from nothing but the framework and the component library: no site CSS, no custom components, no JavaScript beyond what the components ship with. It is both a working template and the proof that the library composes into a real page. **[Open the live template](/templates/marketing)**, and use the switcher in its bottom corner to flip the whole page between the default look and the [wireframe theme](/docs/themes): same markup, one stylesheet swapped. The copy is in on the joke. The structure is the one every one-pager uses (hero, feature grid, testimonials, three pricing tiers, FAQ, closing CTA) and the words point at each convention as it arrives. Replace them with your own and the page stops winking. From top to bottom it composes: [Banner](/components/banner), [Header](/components/header) (sticky, with mobile menu), [Hero](/components/hero) (full variant on a gradient), [Section](/components/section) with a [FeatureGrid](/components/featuregrid), a filled Section of [Testimonials](/components/testimonial) on the grid, a [Pricing](/components/pricing) row, an [FAQ](/components/faq) with exclusive-open items, the closing-CTA Section recipe, and a [Footer](/components/footer). ## Using it Copy [`marketing.astro`][srcTemplate] into your own `src/pages/` (as `index.astro`, most likely) and swap the copy, links, and pricing for your own. The placeholder copy is a bit, so all of it goes. Everything it needs is listed below; if you copied the whole framework and component library per [Getting started](/docs/start), you already have all of it. Two blocks in the file exist for the docs demo and are safe to touch: - The **theme switcher** at the bottom (marked with a comment) is demo chrome. Delete it, or keep the pattern if you want visitors to flip themes at runtime: it toggles the theme stylesheet's `media` attribute between `not all` and `all`. It avoids the `disabled` attribute because Chromium never loads a parser-created disabled stylesheet. - The **inline `@layer` statement** at the top of `` pins the cascade-layer order before any stylesheet loads. Only needed when a theme is loaded as a separate `` (layer priority is set by first occurrence, and the theme link may parse first). If you activate your theme with an `@import` in your entry CSS instead, you can drop it.
| What | Files | | ------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | | The page | `src/pages/templates/marketing.astro` ([source][srcTemplate]) | | Astro components | `Banner`, `Header`, `Hero`, `Section`, `FeatureGrid`, `FeatureItem`, `Testimonial`, `Avatar` (used by Testimonial), `PricingCard`, `Faq`, `FaqItem`, `Footer` ([source][srcComponents]) | | Framework CSS | The framework entry `mcss.css` covers every component style used ([source][srcFramework]) | | Theme (optional) | `theme.wireframe.css`, only if you keep the switcher ([source][srcWireframe]) | | Icons | `menu`, `x`, `check`, `circle-check`, `moon-star`, `external-link`, `rotate-ccw`, `mail`, `heart` ([source][srcIcons]) | | Scripts | `src/scripts/utilities.js` (the Header's scroll throttle) ([source][srcScripts]) |
[srcTemplate]: https://github.com/minimaldesign/mCSS/blob/main/src/pages/templates/marketing.astro [srcComponents]: https://github.com/minimaldesign/mCSS/tree/main/src/components [srcFramework]: https://github.com/minimaldesign/mCSS/tree/main/src/styles/framework [srcWireframe]: https://github.com/minimaldesign/mCSS/blob/main/src/styles/framework/theme.wireframe.css [srcIcons]: https://github.com/minimaldesign/mCSS/tree/main/src/assets/icons [srcScripts]: https://github.com/minimaldesign/mCSS/blob/main/src/scripts/utilities.js ## Recipes worth stealing Even if you don't use the whole page, three patterns in it transfer anywhere: - **The closing CTA** is not a component; it is a `Section` with `variant="primary"` and a `.section_actions` row (see the [Section recipes](/components/section)). - **The pricing row** is three [PricingCards](/components/pricing) on the plain [grid](/docs/global#grid) (`col="1" col-md="3"`), with `highlighted` on the recommended tier. - **Exclusive-open FAQ** items share a `name`, so the browser closes one when another opens. Native `
`, no JavaScript. --- # Getting Started > Part of mCSS (mcss.dev). Rendered page: https://mcss.dev/docs/start mCSS is both a CSS framework and a methodology. You need to first understand the methodology to use the framework correctly. There are 3 main parts to the methodology. 1. The file structure 1. The CSS syntax 1. The component architecture Once you've read through the basics below, the best way to understand how it all comes together is to have a look at the [source code][src]. (Video tutorial coming soon!) ## mCSS file structure
The file structure is based on [ITCSS][1], but with important differences detailed below. The basic idea is to organize your files in different [layers][layers] so that your CSS [rulesets][2] are organized from global low [specificity][3] to local high specificity. When done right, it takes care of all the common "shortcomings" of CSS such as specificity wars and cascading conflicts. mCSS implements this with **native [CSS cascade layers][cascade-layers]**: every framework file is imported into a named `@layer`, and the layer order (not the import order, and not specificity) decides who wins. Anything you write *outside* the layers beats the framework by default, so mCSS always gets out of your way. The only exception is [helper classes][helpers], which use `!important` so they can override anything, including your own CSS. Below is an overview of each layer. The full documentation of most layers is available from the sidebar. This is how mCSS is organized. ([Github source][4].) ```css @layer settings, base, elements, global, components, theme, helpers; /* Build-time only (media queries + mixins definitions) */ @import url(./settings.media-queries.css); @import url(./settings.mixins.css); @import url(./settings.tokens.css) layer(settings); @import url(./settings.ui.css) layer(settings); @import url(./base.reset.css) layer(base); @import url(./elements.sectioning.css) layer(elements); @import url(./elements.text.css) layer(elements); /* etc. */ @import url(./global.grid.css) layer(global); @import url(./global.wrap.css) layer(global); /* etc. */ @import url(./component.button.css) layer(components); @import url(./component.notice.css) layer(components); /* etc. */ @import url(./help.spacing.css) layer(helpers); /* etc. */ /* Optional: activate ONE theme, a swappable skin. Theme files are self-layered (@layer theme), so no layer() annotation is needed. None imported = the default look. */ @import url(./theme.wireframe.css); /* Your site's own CSS imports UNLAYERED, after the framework. Its normal declarations win over every mCSS layer without fighting specificity. One exception: helpers are !important and beat unlayered CSS too. */ @import url(./site/myComponent.css); ``` [cascade-layers]: https://developer.mozilla.org/en-US/docs/Web/CSS/@layer The easiest ways to use mCSS in your own project: - **Drop-in file**: grab [`dist/mcss.css`][dist-css] (or [`dist/mcss.min.css`][dist-min]), the whole framework in one file, no build step needed. - **Individual files**: every framework file is also available pre-processed in [`dist/css/`][dist-dir] (with [`dist/css/mcss.css`][dist-index] as an `@import` index), so you can copy just the layers you need. - **Source files**: copy [`src/styles/framework/`][framework-src] if you run PostCSS yourself (the source uses `@custom-media`, which needs [postcss-preset-env][7]). Run `npm run build:css` in the repo to produce `dist/` from source. [dist-css]: https://github.com/minimaldesign/mCSS/blob/main/dist/mcss.css [dist-min]: https://github.com/minimaldesign/mCSS/blob/main/dist/mcss.min.css [dist-dir]: https://github.com/minimaldesign/mCSS/tree/main/dist/css [dist-index]: https://github.com/minimaldesign/mCSS/blob/main/dist/css/mcss.css [framework-src]: https://github.com/minimaldesign/mCSS/tree/main/src/styles/framework ### Settings Settings are where all custom properties are set. - [Tokens][5] is where you set default values for sizes, font stacks, colors, transitions, etc. See [the docs][5] for all the values available by default. - [Interface tokens][interfaceTokens] are an abstraction level to standardize common values across elements and components. For instance, components use `--ui-border-color` instead of the lower level token `--base-200`, so one override restyles every bordered surface. - [Media queries][6] include responsive sizes, as well as user preferences like color schemes, reduced motion, etc. See [media queries docs][6]. - **Mixins** is optional. It is not used in other parts of mCSS by default but can be useful to streamline your own components' code. It requires a [PostCSS plugin][7] to work. ### Base - Simple reset/normalize. ### HTML Elements The default styling of all HTML elements, without classes. - **Sectioning:** `header`, `footer`, etc. - **Text:** `a`, `p`, etc. - **Quotes:** adds the correct quotes depending on language. - **Media:** `img`,`video`, etc. - **Table:** `table`, `th`, etc. - **Form:** `input`, `button`, etc. - **Interactive:** `dialog`, `details`. ### Global Global styles inlcluded out of the box: - A responsive [grid system][grid]. - A full feature [wrapper][wrap]. - Common global site [layouts][layout]. - [Typography][prose], via the `.prose` class, for long form text, like articles, etc. - [Accessibility][a11y] (A11Y) specific classes. - Basic `@keyframes` animations (e.g., fade in/out) ### Components Self-contained styles for single components, one block per file. The mCSS framework is designed to be used on its own, allowing you to create your own components, but a [collection of components][components] built on top of mCSS is included. Some components are **CSS-only**: a single class on a single element, with no Astro component because there is no markup structure to encapsulate. For example, the `.badge` class on a `` is the whole badge, and the `.bt` class can style a `

### Meter ```html 2 out of 10 5 out of 10 8 out of 10 ```

2 out of 10

5 out of 10

8 out of 10

### Progress

70%

## Media
| File name | Source | | -------------------- | ------------------ | | `elements.media.css` | [Github][srcMedia] | [srcMedia]: https://github.com/minimaldesign/mCSS/blob/main/src/styles/framework/elements.media.css
  • Plain `` element Saxophonist playing in Central Park
  • `
    ` element with `` element
    Saxophonist playing in Central Park
  • `
    ` element with `` and `
    ` elements
    Saxophonist playing in Central Park
    Here is a caption for this image.
  • `
    ` element with a `` element
    Saxophonist playing in Central Park
### Audio
### Video
### Canvas canvas
### Inline Frame
### Inline SVG ## Interactive
| File name | Source | | -------------------- | ------------------ | | `elements.interactive.css` | [Github][srcInteractive] | [srcInteractive]: https://github.com/minimaldesign/mCSS/blob/main/src/styles/framework/elements.interactive.css ### Details & Summary
Expand for details

Lorem ipsum dolor sit amet consectetur adipisicing elit. Cum, odio! Odio natus ullam ad quaerat, eaque necessitatibus, aliquid distinctio similique voluptatibus dicta consequuntur animi. Quaerat facilis quidem unde eos! Ipsa.

### Dialog

A random quote you might enjoy…

If you want to awaken all of humanity, then awaken all of yourself. If you want to eliminate the suffering of the world, then eliminate all that is negative in yourself. Truly the greatest gift you have to give is that of your own self-transformation.

--- # Global Styles > Part of mCSS (mcss.dev). Rendered page: https://mcss.dev/docs/global ## Grid
| File name | Source | | ----------------- | ----------------- | | `global.grid.css` | [Github][srcGrid] |
[srcGrid]: https://github.com/minimaldesign/mCSS/blob/main/src/styles/framework/global.grid.css The grid system is extremely easy to use, light weight, and very flexible. It uses the [CSS grid property](https://developer.mozilla.org/en-US/docs/Web/CSS/grid) under the hood, but it lets you set up your layouts directly into your HTML. The implementation is heavily inspired by [Raster](https://github.com/rsms/raster). ### Syntax It's composed of 2 classes: `.grid` for the container, and `.grid_item` for each grid item. The default grid gap is defined as a custom property in [`settings.ui.css`](/docs/tokens#interface-tokens) and is responsive: `16px` (`--sm1`) on small screens, stepping up to `24px` (`--sm3`) at the `--md` breakpoint (768px). You can override `--grid-column-gap` and `--grid-row-gap` globally in your own theme, or on a specific `.grid` element. A `grid-flush` modifier is available if you don't want any gap. Because `.grid` reads its gaps from those two custom properties, overriding a specific grid is just a matter of setting them on the element. Add a class of your own: ```css .photoWall { --grid-column-gap: var(--xs2); --grid-row-gap: var(--xs2); } ``` ```html
    ...
``` You define the amount of columns of your grid with a custom `col` attribute and the position/width of your grid_items with the custom `span` attribute. The `span` property syntax follows these 5 patterns: - `row`: the grid_item spans a full row - `3`: the grid_item start in the next column and spans 3 columns. - `3-5`: the grid_item starts in column 3 and ends in column 5. - `3+5`: the grid_item starts in column 3 and spans for 5 columns. - `3..`: the grid_item starts in column 3 and spans the remainder of rows. Both the `col` and `span` attributes have responsive versions, which use [the "mobile first" approach][1] of the `--*-n-above` media queries. The available tiers are **`-md`, `-lg`, and `-xl`** (`col-md`, `span-lg`, etc.); other suffixes like `col-sm` or `col-xxl` don't exist and are silently ignored. Grids support up to 24 columns. (The file is generated by `src/tools/generate.global.grid.cjs`; add a tier there if you need one.) [1]: /docs/media-queries#recommended-responsive-setup The custom attribute will not validate. If this is important to you, you'll need to change the attributes to `data-col` and `data-span` in both the CSS and HTML. I personally prefer to use shorter, more legible attributes. Check this thread on Github if you'd like to read more than you've ever wanted to know about [custom attributes and validation](https://github.com/whatwg/html/issues/2271). ### Examples #### Different types of spans 9 colum grid, with all types of spans.
2
4-5
6..
2-3
5..
2+3
6+2
row
4+2
```html
2
4-5
6..
2-3
5..
2+3
6+2
row
4+2
``` #### Responsive grid The grid layout follows a "mobile first" approach using `--*-n-above` media queries. The following example goes from 1 → 4 → 9 → 12 columns. (Resize window to see it in action.)
1
2
3
4
5
6
7
8
9
10
11
12
```html
[…]
``` ## Wrap
| File name | Source | | ----------------- | ----------------- | | `global.wrap.css` | [Github][srcWrap] |
[srcWrap]: https://github.com/minimaldesign/mCSS/blob/main/src/styles/framework/global.wrap.css The `.wrap` global class is a simple content wrapper that will center your content on the page and add some left/right padding on small viewports. The content column comes in three width presets, set with a modifier on the wrapper: `.wrap-sm`, `.wrap-md`, and `.wrap-lg`. A bare `.wrap` uses the `md` width (`minmax(200px, 70ch)`). There is also a `.wrap_content-fullBleed` modifier for children that should extend to the full size of the viewport. See [demo](/demos/wrap). ### Syntax ```html
``` ### Settings You can customize 3 diffent sizes of left/right padding for responsive designs as well as the width of your content. The values below are set in `settings.ui.css`.
| token | value | Description | | ----------------- | ---------------------- | -------------------------------- | | `wrap-spacing` | `var(--sm1)` | default left/right padding | | `wrap-md-spacing` | `var(--sm3)` | left/right padding tablet and up | | `wrap-lg-spacing` | `0` | left/right padding laptop and up | | `wrap-width-sm` | `minmax(200px, 55ch)` | narrow column (`.wrap-sm`) | | `wrap-width-md` | `minmax(200px, 70ch)` | reading column (`.wrap-md`) | | `wrap-width-lg` | `minmax(200px, 900px)` | wide column (`.wrap-lg`) | | `wrap-width` | `var(--wrap-width-md)` | width of a bare `.wrap` |
- More info on [themes](/docs/themes). - More info on [responsive setup](/docs/media-queries#recommended-responsive-setup). ## Layouts
| File name | Source | | ------------------- | ------------------- | | `global.layout.css` | [Github][srcLayout] |
[srcLayout]: https://github.com/minimaldesign/mCSS/blob/main/src/styles/framework/global.layout.css This is where your global layouts should go. It's probably too project specific for mCSS to ship with really useful default layouts. But this will change as more [components](/components/start) become available. The layouts in this file are specific to mcss.dev docs and blog sections. They're not built as templates to use in your own projects but rather as examples of how to set it up. ## Prose
| File name | Source | | ------------------ | ------------------ | | `global.prose.css` | [Github][srcProse] |
[srcProse]: https://github.com/minimaldesign/mCSS/blob/main/src/styles/framework/global.prose.css The global `.prose` class can be used anywhere you need basic typography for long form text, like articles, blog posts, etc. It makes spacing between paragraphs, lists, tables, etc. consistent. This spacing can be modified in your [theme](/docs/themes) via the `--prose-spacing` token. The `.prose` class also adds extra styling for `ol`, `ul`, and `code` elements. ## Accessibility
| File name | Source | | ----------------- | ----------------- | | `global.a11y.css` | [Github][srcA11y] |
[srcA11y]: https://github.com/minimaldesign/mCSS/blob/main/src/styles/framework/global.a11y.css This is where accessibility specific classes go. Currently a WIP as [components are being created](/components/start). ## Animation
| File name | Source | | ---------------------- | ---------------------- | | `global.animation.css` | [Github][srcAnimation] |
[srcAnimation]: https://github.com/minimaldesign/mCSS/blob/main/src/styles/framework/global.animation.css Basic fade in/out animations with flexible start/end opacity values. (More info about [forwards](/blog/css-animation-fill-modes)) ```css .element { opacity: 0.8; animation: fadeToTransparent 1s forwards; } ``` --- # Helpers > Part of mCSS (mcss.dev). Rendered page: https://mcss.dev/docs/helpers Helpers are classes for very targeted "one-off" local overrides. Every helper declaration uses `!important`, and because they live in an mCSS [cascade layer](/docs/start#mcss-file-structure), that beats everything: all framework layers, your own unlayered CSS, even normal inline styles. Think of a helper as inline styling for a single element. That power is exactly why they should be used as little as possible, but they're useful for things like: - Designer's request to "make an exception" - Quick fix until refactor - Temporary test/design Let's say the request is: _"This component just doesn't look right in that context, can we just increase the top and bottom padding?"_ You would use the spacing helper this way: ```html

Content goes here.

``` Using helpers is optional and mCSS will work just fine without them. None of the mCSS components rely on them. If you do use them in your project, it's recommended to use [PurgeCSS](https://purgecss.com/getting-started.html) to keep your CSS size to a minimum. For Astro users, the [astro-purgecss integration](https://github.com/codiume/orbit/tree/main/packages/astro-purgecss) does everything for you out of the box once you install it. Below is a list of all the available helpers. mCSS doesn't include every single CSS property like utility classes frameworks do. It only includes the ones you actually need in those "one-off" situations. I've never needed more than that, but I'm open to add anything that would be useful. Just [open an issue on Github](https://github.com/minimaldesign/mCSS/issues) with your use case and I'll add it in. ## Spacing | File name | Source | | ------------------ | -------------------- | | `help.spacing.css` | [Github][srcSpacing] | [srcSpacing]: https://github.com/minimaldesign/mCSS/blob/main/src/styles/framework/help.spacing.css ### width, height, margin, and padding You can combine these properties with any [dimension token](/docs/tokens#dimension) as well as `0`: | CSS property | Class prefix | | ---------------------- | ------------ | | `width` | `w` | | `height` | `h` | | `margin` | `m` | | `margin-top` | `mt` | | `margin-bottom` | `mb` | | `margin-left` | `ml` | | `margin-right` | `mr` | | `margin-inline-start` | `mis` | | `margin-inline-end` | `mie` | | `padding` | `p` | | `padding-top` | `pt` | | `padding-bottom` | `pb` | | `padding-left` | `pl` | | `padding-right` | `pr` | | `padding-inline-start` | `pis` | | `padding-inline-end` | `pie` | Both directional sets exist on purpose. Use the logical helpers (`mis`, `mie`, `pis`, `pie`) when the spacing follows the reading direction: an icon gap, a list indent, anything that should flip in a right-to-left layout. Use the physical helpers (`ml`, `mr`, `pl`, `pr`) when the offset is a purely visual choice that should stay on the same side no matter the script direction. In a left-to-right layout they resolve identically. #### Examples | Class | Value | | --------- | ---------------------------------- | | `w-lg1` | `width: var(--lg1)` | | `ml-0` | `margin-left: 0` | | `mb-sm1` | `margin-bottom: var(--sm1)` | | `pis-md1` | `padding-inline-start: var(--md1)` | ```html
A component with an extra bottom margin of 48px.
A component with an extra padding of 28px.
``` ## Colors | File name | Source | | ----------------- | ------------------- | | `help.colors.css` | [Github][srcColors] | [srcColors]: https://github.com/minimaldesign/mCSS/blob/main/src/styles/framework/help.colors.css ### color, background-color, and border-color You can combine this properties with any [color token](/docs/tokens#color): | CSS property | Class prefix | | ------------------ | ------------ | | `color` | `c` | | `background-color` | `bgc` | | `border-color` | `bdc` | #### Examples
| Class | Value | | --------------- | ----------------------------------- | | `bgc-base-200` | `background-color: var(--base-200)` | | `bdc-yes-500` | `border-color: var(--yes-500)` | | `c-primary-500` | `color: var(--primary-500)` |

A block with custom colors.

```html

A block with custom colors.

``` ## Layout | File name | Source | | ----------------- | ------------------- | | `help.layout.css` | [Github][srcLayout] | [srcLayout]: https://github.com/minimaldesign/mCSS/blob/main/src/styles/framework/help.layout.css ### overflow
| CSS property | CSS value | Class | Short class | | ------------ | --------- | --------------------- | --------------- | | `overflow` | `auto` | `.overflow-auto` | `.of-auto` | | `overflow` | `hidden` | `.overflow-hidden` | `.of-hidden` | | `overflow` | `clip` | `.overflow-clip` | `.of-clip` | | `overflow` | `visible` | `.overflow-visible` | `.of-visible` | | `overflow` | `scroll` | `.overflow-scroll` | `.of-scroll` | | `overflow-x` | `auto` | `.overflow-x-auto` | `.of-x-auto` | | `overflow-y` | `auto` | `.overflow-y-auto` | `.of-y-auto` | | `overflow-x` | `hidden` | `.overflow-x-hidden` | `.of-x-hidden` | | `overflow-y` | `hidden` | `.overflow-y-hidden` | `.of-y-hidden` | | `overflow-x` | `clip` | `.overflow-x-clip` | `.of-x-clip` | | `overflow-y` | `clip` | `.overflow-y-clip` | `.of-y-clip` | | `overflow-x` | `visible` | `.overflow-x-visible` | `.of-x-visible` | | `overflow-y` | `visible` | `.overflow-y-visible` | `.of-y-visible` | | `overflow-x` | `scroll` | `.overflow-x-scroll` | `.of-x-scroll` | | `overflow-y` | `scroll` | `.overflow-y-scroll` | `.of-y-scroll` |
### position Helper classes for the `position` property.
| CSS value | Class | | ---------- | -------------------- | | `static` | `.position-static` | | `fixed` | `.position-fixed` | | `absolute` | `.position-absolute` | | `relative` | `.position-relative` | | `sticky` | `.position-sticky` |
### visibility Helper classes for the `visibility` property.
| CSS value | Class | | ---------- | ---------------------- | | `visible` | `.visibility-visible` | | `hidden` | `.visibility-hidden` | | `collapse` | `.visibility-collapse` |
### z-index Helper classes for the `z-index` property. See also the [z-index token docs](docs/tokens#z-index).
| Custom Property | CSS Value | Class | | --------------- | ----------- | ----------- | | `--z-bottom` | -1000000000 | `.z-bottom` | | `--z-0` | 0 | `.z-0` | | `--z-1` | 10 | `.z-1` | | `--z-2` | 20 | `.z-2` | | `--z-3` | 30 | `.z-3` | | `--z-4` | 40 | `.z-4` | | `--z-5` | 50 | `.z-5` | | `--z-top` | 1000000000 | `.z-top` |
## Aspect ratios | File name | Source | | ----------------- | ------------------- | | `help.ratios.css` | [Github][srcRatios] | [srcRatios]: https://github.com/minimaldesign/mCSS/blob/main/src/styles/framework/help.ratios.css
| Custom Property | CSS Value | Class | | ----------------- | --------- | ---------------- | | `--ar-square` | 1 | `.ar-square` | | `--ar-landscape` | 4/3 | `.ar-landscape` | | `--ar-portrait` | 3/4 | `.ar-portrait` | | `--ar-widescreen` | 16/9 | `.ar-widescreen` | | `--ar-golden` | 1.618/1 | `.ar-golden` |
## Opacity | File name | Source | | ------------------ | -------------------- | | `help.opacity.css` | [Github][srcOpacity] | [srcOpacity]: https://github.com/minimaldesign/mCSS/blob/main/src/styles/framework/help.opacity.css | Custom Property | CSS Value | Class | | --------------- | --------- | ------ | | `--o-0` | 0 | `.o-0` | | `--o-1` | 0.2 | `.o-1` | | `--o-2` | 0.4 | `.o-2` | | `--o-3` | 0.6 | `.o-3` | | `--o-4` | 0.8 | `.o-4` | | `--o-5` | 1 | `.o-5` | ## Typography | File name | Source | | --------------------- | ----------------------- | | `help.typography.css` | [Github][srcTypography] | [srcTypography]: https://github.com/minimaldesign/mCSS/blob/main/src/styles/framework/help.typography.css ### font-family See the [font stack tokens](/docs/tokens#font-stack) for details.
| Custom Property | Class | | --------------- | --------------- | | `--text` | `.font-text` | | `--display` | `.font-display` | | `--mono` | `.font-mono` |
### font-style | CSS value | Class | | --------- | -------------- | | `italic` | `.font-italic` | | `normal` | `.font-normal` | ### font-weight See the [font weight tokens](/docs/tokens#font-weight) for details.
| Custom Property | Class | | --------------- | ------------------- | | `--extra-light` | `.font-extra-light` | | `--light` | `.font-light` | | `--book` | `.font-book` | | `--semi-bold` | `.font-semi-bold` | | `--bold` | `.font-bold` | | `--black` | `.font-black` |
### font-size See the [font size tokens](/docs/tokens#font-size) for details. | Custom Property | Class | | --------------- | ------------- | | `--text-xs` | `.text-xs` | | `--text-sm` | `.text-sm` | | `--text-md` | `.text-md` | | `--text-lg` | `.text-lg` | | `--text-xl` | `.text-xl` | | `--display-sm` | `.display-sm` | | `--display-md` | `.display-md` | | `--display-lg` | `.display-lg` | | `--display-xl` | `.display-xl` | ### line-height See the [line height tokens](/docs/tokens#line-height) for details. | Custom Property | Class | | --------------- | -------------- | | `--leading-xs` | `.leading-xs` | | `--leading-sm` | `.leading-sm` | | `--leading-md` | `.leading-md` | | `--leading-lg` | `.leading-lg` | | `--leading-xl` | `.leading-xl` | | `--leading-xxl` | `.leading-xxl` | ### text-align | CSS value | Class | | --------- | --------------- | | `left` | `.text-left` | | `center` | `.text-center` | | `right` | `.text-right` | | `justify` | `.text-justify` | | `start` | `.text-start` | | `end` | `.text-end` | Same split as the spacing helpers: `.text-start` and `.text-end` follow the reading direction (they flip in a right-to-left layout), `.text-left` and `.text-right` always mean the visual side. ### text-transform | CSS value | Class | | ------------ | ------------------ | | `uppercase` | `.text-uppercase` | | `lowercase` | `.text-lowercase` | | `capitalize` | `.text-capitalize` | --- # AI Agents > Part of mCSS (mcss.dev). Rendered page: https://mcss.dev/docs/ai mCSS is built to be easy for AI coding agents (Claude Code, Cursor, Copilot, and friends) to work with. The docs are available in machine-readable form, and this page includes a rules block you can paste into your project's agent instructions so generated markup is idiomatic mCSS instead of a plausible-looking guess. ## Machine-readable docs Three things exist specifically for agents: - **[/llms.txt](/llms.txt)**: an index of every docs and components page with one-line descriptions, following the [llms.txt](https://llmstxt.org) convention. Most agent tooling checks for this automatically. - **[/llms-full.txt](/llms-full.txt)**: the entire reference (docs and all components) concatenated into a single markdown file. Point an agent here when it needs the whole framework in one fetch. - **Markdown twins**: every docs and components page is also served as plain markdown at the same URL with `.md` appended. For example, [/docs/tokens.md](/docs/tokens.md) or [/components/card.md](/components/card.md). These are a fraction of the size of the HTML pages and contain no site chrome. If you tell your agent one thing, tell it this: fetch the `.md` URLs, not the HTML. ## Add mCSS rules to your agent instructions Paste the block below into your project's `CLAUDE.md`, `AGENTS.md`, or equivalent. It compresses the conventions that matter most when writing mCSS markup and CSS on top of it. ````md ## mCSS conventions This project uses mCSS (https://mcss.dev), a copy-it-you-own-it CSS framework. The framework files live in this repo, not in node_modules; treat them as project code, not as an immutable dependency. Full reference: https://mcss.dev/llms-full.txt Per-page markdown docs: append `.md` to any docs or components URL (e.g. https://mcss.dev/components/card.md). ### Class naming (BEM-like, different separators) - Block: `.componentName` (camelCase for multi-word names) - Element: `.componentName_element` (single underscore; chains may nest as deep as the block's own structure needs) - Modifier: `.componentName-modifier` (single hyphen), for build-time variants - State: `.is-*` (`.is-active`, `.is-open`), only for things that change at runtime, always scoped inside the block - Prefer styling ARIA attributes over inventing state classes when one exists: `[aria-current]`, `[aria-expanded="true"]`, `[aria-disabled="true"]` ### Never couple classes from different components A selector must only contain classes from its own block. Never write a selector that reaches into another component (`.myPage .card_title` is banned). To style a component from outside: mix your own class onto its root in the markup and style that, or set the component's interface tokens (`--card-*`, `--bt-*`, ...) on your own hook class. Bare HTML tags, `.is-*`, and ARIA selectors are fine inside your own block. ### Customization (you own the files) - Customize by editing the framework files directly, tokens first: change `settings.tokens.css` values (colors, type, spacing) before touching component CSS. - Component tokens follow `--component-part-property`, longhand, kebab-case: `--bt-background-color-hover`, `--notice-border-width`. No abbreviations. - Prefer semantic feedback tokens (`--success-*`, `--danger-*`, `--warning-*`). ### Cascade model (native @layer) - The framework lives in cascade layers; your unlayered project CSS beats all of it by design. Never add `!important` to win against the framework. - The exception: helper classes (`help.*` files, e.g. spacing/color/typography utilities) carry `!important` and beat everything, like inline styles. - Never use `transition: all`; list the properties that actually animate. ```` ## MCP and tooling There is no mCSS MCP server yet. For now, `llms-full.txt` plus the rules block above is the recommended setup. If your agent supports fetching URLs at runtime, the markdown twins are the cheapest way to pull a single component's markup reference into context. --- # Getting started > Part of mCSS (mcss.dev). Rendered page: https://mcss.dev/components/start The mCSS component library is entirely built with the [mCSS framework](/docs/start), and you **own the code**: instead of installing a package, you copy the pieces you want into your project and edit them like anything else you wrote. Every component's docs page has a "What to copy" table listing exactly which files, icons, and interface tokens it needs. Each component comes in two flavors: - **Plain HTML + CSS.** Copy the `component.*.css` file (or grab the compiled version from [`dist/css/`](https://github.com/minimaldesign/mCSS/tree/main/dist/css)) and use the documented markup. Works with any framework, or none. - **Astro.** Copy the `.astro` file(s) for typed props, slots, and sensible accessibility defaults out of the box. Components stay deliberately close to the platform: almost everything here is zero-JavaScript (the exceptions are the [header](/components/header)'s mobile menu and the dismissible [banner](/components/banner), a few lines each). Styling lives in [cascade layers](/docs/start), so your own unlayered CSS always wins, and every visual knob is a documented `--component-*` [interface token](/docs/tokens#interface-tokens). You can see some of the Astro components in action on the [Marketing Template](/templates/marketing) ([code](https://github.com/minimaldesign/mCSS/blob/main/src/pages/templates/marketing.astro)). Spotted a bug, or built something worth sharing? [Issues and discussions](https://github.com/minimaldesign/mCSS/issues) are open. --- # Avatar > Part of mCSS (mcss.dev). Rendered page: https://mcss.dev/components/avatar The `.avatar` component is a visual representation of a user. It shows the user's initials or an image thumbnail. Its default size is 56px. (See the [HTML](#html) section below for all options.) SR
| File | Description | Source | | ---------------------- | ----------- | ----------- | | `component.avatar.css` | All avatar styles (`.avatar`) | [Github][1] |
[1]: https://github.com/minimaldesign/mCSS/blob/main/src/styles/framework/component.avatar.css ## Playground
{content}
`} baseClasses="avatar" snippets={{ initials: { preview: "SR", code: "SR" }, image: { preview: `Sonny Rollins`, code: `Sonny Rollins`, }, }} controls={[ { heading: "Variation", items: [ { type: "select", name: "size", label: "Size", default: "", options: [ { label: "Default", value: "" }, { label: "Small", value: "avatar-sm" }, { label: "Medium", value: "avatar-md" }, { label: "Large", value: "avatar-lg" }, { label: "Extra large", value: "avatar-xl" }, ]}, ]}, { heading: "State", items: [ { type: "select", name: "status", label: "Status", default: "", options: [ { label: "None", value: "" }, { label: "Online", value: "is-online" }, { label: "Offline", value: "is-offline" }, ]}, ]}, { heading: "Content", items: [ { type: "select", name: "content", label: "Show", snippet: "content", default: "initials", options: [ { label: "Initials", value: "initials", class: "", snippet: "initials" }, { label: "Image", value: "image", class: "", snippet: "image" }, ]}, ]}, ]} /> ## HTML ### Available modifiers
| Available modifiers | Description | | ----------------------------- | -------------------------- | | `.avatar` | Default - 56px | | `.avatar` + `.avatar-sm` | Small - 24px | | `.avatar` + `.avatar-md` | Medium - 36px | | `.avatar` + `.avatar-lg` | Large - 80px | | `.avatar` + `.avatar-xl` | Extra large - 128px | | `.avatar` + `.is-online` | User is online - green dot | | `.avatar` + `.is-offline` | User is offline - grey dot |
### Custom properties The following custom properties are available in [`settings.ui.css`](/docs/tokens#interface-tokens):
| Property | Color | | ----------------------------------- | --------------------------------- | | `--avatar-color` | Text color (when no image). | | `--avatar-background-color` | Background color (when no image). | | `--avatar-border-color` | Border color. | | `--avatar-border-width` | Border width. | | `--avatar-radius` | Radius. (`0` = square). | | `--avatar-status-dot-color-offline` | Status dot color: offline. | | `--avatar-status-dot-color-online` | Status dot color: online. |
## Astro component
| Prop | Type | Default | Description | | ------------ | --------- | --------- | ----------------------------------------------------------- | | `size` | `string` | undefined | `sm`, `md`, `lg`, `xl` ([px values](#html)) | | `imageSrc` | `string` | undefined | Optional image. | | `status` | `'online' \| 'offline'` | `undefined` | Shows a status dot (green online / grey offline) | | `class` | `string` | undefined | Additional CSS classes, useful for [helper classes](/docs/helpers). |
## Examples
  • ### Full name vs initials Sonny Rollins SR ```astro --- import Avatar from "../../components/Avatar.astro"; --- Sonny Rollins SR ``` The astro component can take initials or a full name and will output initials if an image is not provided. It will output the full name in the `alt` attribute if an image is provided.
  • ### Offline large avatar Sonny Rollins ```astro --- import Avatar from "../../components/Avatar.astro"; import imageSrc from "../../assets/images/sonny.png"; --- Sonny Rollins ```
### HTML examples
  • SR ```html
    SR
    ```
--- # Badge > Part of mCSS (mcss.dev). Rendered page: https://mcss.dev/components/badge The badge is a small label for statuses, categories, and "new" markers. It is a [CSS-only component](/docs/start#components): there is no Astro file because a `` with the `.badge` class is already the whole API.

defaultprimarysuccessdangerwarning

| File | Description | Source | | ---------------------------------- | ------------------------------ | ----------- | | `component.badge.css` | All badge styles | [Github][1] | | `--badge-*` block in `settings.ui.css` | Interface tokens (see table below) | [Github][2] |
[1]: https://github.com/minimaldesign/mCSS/blob/main/src/styles/framework/component.badge.css [2]: https://github.com/minimaldesign/mCSS/blob/main/src/styles/framework/settings.ui.css ## Playground {label}
'} baseClasses="badge" controls={[ { heading: "Variation", items: [ { type: "select", name: "color", label: "Color", default: "", options: [ { label: "Default", value: "" }, { label: "Primary", value: "badge-primary" }, { label: "Success", value: "badge-success" }, { label: "Danger", value: "badge-danger" }, { label: "Warning", value: "badge-warning" }, ]}, ]}, { heading: "Content", items: [ { type: "text", name: "label", label: "Label", default: "new" }, ]}, ]} /> ## HTML ```html default shipped ``` ### Available modifiers
| Class | Description | | ---------------------------- | --------------------------------- | | `.badge` | Default style. Neutral colors. | | `.badge` + `.badge-primary` | Primary colors. | | `.badge` + `.badge-success` | Positive feedback. Greens. | | `.badge` + `.badge-danger` | Negative feedback. Reds. | | `.badge` + `.badge-warning` | Warning. Oranges. |
One-off colors work like every other variant in mCSS: override the local custom property. ```html custom ``` ### Custom properties The following custom properties are available in [`settings.ui.css`](/docs/tokens#interface-tokens):
| Property | Description | | ------------------------------------ | ------------------------------ | | `--badge-font-size` | Font size. | | `--badge-border-radius` | Border radius. | | `--badge-color` | Default text color. | | `--badge-background-color` | Default background color. | | `--badge-primary-color` | Primary variant text color. | | `--badge-primary-background-color` | Primary variant background. | | `--badge-success-color` | Success variant text color. | | `--badge-success-background-color` | Success variant background. | | `--badge-danger-color` | Danger variant text color. | | `--badge-danger-background-color` | Danger variant background. | | `--badge-warning-color` | Warning variant text color. | | `--badge-warning-background-color` | Warning variant background. |
--- # Banner > Part of mCSS (mcss.dev). Rendered page: https://mcss.dev/components/banner The `.banner` component is the thin announcement bar at the very top of the page, optionally dismissible (remembered in `localStorage`).

mCSS v1 is out! Read the announcement

| File | Description | Source | | ----------------------------------- | ------------------------------ | ----------- | | `component.banner.css` | All banner styles | [Github][1] | | `Banner.astro` | The Astro component | [Github][2] | | `icons/x.svg` | Dismiss icon | [Github][3] | | `--banner-*` block in `settings.ui.css` | Interface tokens (see table below) | [Github][4] |
[1]: https://github.com/minimaldesign/mCSS/blob/main/src/styles/framework/component.banner.css [2]: https://github.com/minimaldesign/mCSS/blob/main/src/components/Banner.astro [3]: https://github.com/minimaldesign/mCSS/tree/main/src/assets/icons [4]: https://github.com/minimaldesign/mCSS/blob/main/src/styles/framework/settings.ui.css ## Playground
`} baseClasses="section" controls={[ { heading: "Variation", items: [ { type: "select", name: "variant", label: "Variant", default: "", options: [ { label: "Default", value: "" }, { label: "Filled", value: "section-filled" }, { label: "Primary", value: "section-primary" }, ]}, ]}, { heading: "Content", items: [ { type: "text", name: "eyebrow", label: "Eyebrow", default: "Why mCSS" }, { type: "text", name: "title", label: "Title", default: "Everything is a section" }, { type: "text", name: "lede", label: "Lede", default: "Stack a few of these and you have a landing page." }, ]}, ]} /> ## HTML ```html

Why mCSS

Everything is a section

Stack a few of these and you have a landing page.

``` The header and content each compose `.wrap` with a [width preset](/docs/global#wrap) (`.wrap-sm`, `.wrap-md`, `.wrap-lg`), so they can use different column widths. `wrap-md` on the header and `wrap-lg` on the content is the standard pairing; use `wrap-md` on the content too when it is text meant for reading (an FAQ, for example). ### Available modifiers
| Class | Description | | --------------------------------- | ------------------------------------------------------------------ | | `.section` | Default. Transparent background, `--section-spacing` vertical padding. | | `.section` + `.section-filled` | Subtle filled band. | | `.section` + `.section-primary` | Primary-colored band; text and links switch to the inverted colors. |
### Elements
| Class | Description | | ------------------ | ---------------------------------------------------------------- | | `.section_header` | Centered eyebrow/title/lede block; composes `.wrap` + a width preset. | | `.section_content` | Content column; composes `.wrap` + a width preset. | | `.section_eyebrow` | Small uppercase kicker. | | `.section_title` | The `h2`. | | `.section_lede` | Intro paragraph. | | `.section_actions` | Centered, wrapping button row (see the closing-CTA recipe below). |
### Custom properties The following custom properties are available in [`settings.ui.css`](/docs/tokens#interface-tokens):
| Property | Description | | ------------------------------------ | ---------------------------------------- | | `--section-spacing` | Vertical padding of the band. | | `--section-header-spacing` | Space between the header and content. | | `--section-eyebrow-color` | Eyebrow text color. | | `--section-lede-color` | Lede text color. | | `--section-filled-background-color` | Background of the filled variant. | | `--section-primary-background-color` | Background of the primary variant. | | `--section-primary-text-color` | Text color on the primary variant. | | `--section-primary-link-color` | Link color on the primary variant. | | `--section-primary-link-color-hover` | Link hover color on the primary variant. | | `--section-primary-eyebrow-color` | Eyebrow color on the primary variant. | | `--section-primary-lede-color` | Lede color on the primary variant. |
## Astro component
| Prop | Type | Default | Description | | --------- | -------- | ----------- | ------------------------------------------------------------------- | | `eyebrow` | `string` | `undefined` | Small uppercase kicker above the title. | | `title` | `string` | `undefined` | The section's `h2`. | | `lede` | `string` | `undefined` | Intro paragraph under the title. | | `variant` | `string` | `undefined` | `filled`, `primary`. | | `headerWrap` | `string` | `md` | Header column width preset: `sm`, `md`, `lg`. | | `contentWrap` | `string` | `lg` | Content column width preset: `sm`, `md`, `lg`. | | `headerClass` | `string` | `undefined` | Extra classes mixed onto `.section_header`. | | `contentClass` | `string` | `undefined` | Extra classes mixed onto `.section_content`. | | `class` | `string` | `undefined` | Additional CSS classes, useful for [helper classes](/docs/helpers). |
Any other attribute is passed through to the root `
` element (handy for `id` anchors). The default slot is the section content. ## Examples
  • Text and links flip to the inverted palette.

    ```astro --- import Section from "../components/Section.astro"; ---

    Text and links flip to the inverted palette.

    ```
  • By default the content column is wider (`wrap-lg`) than the header (`wrap-md`); set `contentWrap="md"` to keep long-form content at reading width:
    1
    2
    3
    ```astro
    ```
  • The closing CTA every marketing page ends on is not a separate component; it is a Section with a `.section_actions` row:
    ```astro
    ```
--- # Social Media Links > Part of mCSS (mcss.dev). Rendered page: https://mcss.dev/components/socialmedia
The `.socialMedia` component consists of an unordered list of links to social media accounts and their corresponding icons.
| File | Description | Source | | --------------------------- | ----------- | ----------- | | `component.socialMedia.css` | All social links styles (`.socialMedia`) | [Github][1] |
[1]: https://github.com/minimaldesign/mCSS/blob/main/src/styles/framework/component.socialMedia.css The following 4 sizes and 19 icons (18 social media platforms + 1 generic link icon) are available out of the box.
| Platform | Icon | | ----------- | -------------------------------------------- | | Unknown URL | | | Discord | | | Facebook | | | Github | | | Instagram | | | Linkedin | | | Pinterest | | | Reddit | | | Snapchat | | | Telegram | | | Tiktok | | | X | | | Youtube | | | Twitch | | | Odysee | | | Minds | | | Substack | | | Bitchute | | | Bastyon | |
## Playground
  • {x}
  • {github}
  • {youtube}
  • `} baseClasses="socialMedia" snippets={{ x: { preview: xIcon, code: "[…]" }, github: { preview: githubIcon, code: "[…]" }, youtube: { preview: youtubeIcon, code: "[…]" }, }} controls={[ { heading: "Variation", items: [ { type: "select", name: "size", label: "Size", default: "", options: [ { label: "Default", value: "" }, { label: "Medium", value: "socialMedia-md" }, { label: "Large", value: "socialMedia-lg" }, { label: "Extra large", value: "socialMedia-xl" }, ]}, ]}, ]} /> ## HTML
    | Available modifiers | Description | | ---------------------------------- | -------------- | | `.socialMedia` | Default - 24px | | `.socialMedia` + `.socialMedia-md` | 32px | | `.socialMedia` + `.socialMedia-lg` | 44px | | `.socialMedia` + `.socialMedia-xl` | 64px |
    When using the HTML component you'll need to include the SVG icons "manually." All the icons are [available on Github](https://github.com/minimaldesign/mCSS/tree/main/src/assets/icons). If you'd like to use different icons, [Lucide](https://lucide.dev/) is a great resource.
    ## Astro component
    The Astro component ([Github](https://github.com/minimaldesign/mCSS/blob/main/src/components/SocialMedia.astro)) takes 3 props:
    | Prop | Type | Default | Description | | ------------ | -------- | --------- | ----------------------------------------------------------- | | `urls` | `array` | `[]` | An array of urls, or `{ url, label }` objects to override the accessible label (e.g. `"mCSS on GitHub"`). | | `size` | `string` | undefined | `md`, `lg`, `xl`. | | `newTab` | `boolean` | `true` | Open links in a new tab. Set to `false` to opt out. | | `class` | `string` | undefined | Additional CSS classes, useful for [helper classes](/docs/helpers). |
    ## Examples
    • ```astro --- import SocialMedia from "../../components/SocialMedia.astro"; --- ```
    • ```astro --- import SocialMedia from "../../components/SocialMedia.astro"; --- ```
    ### HTML examples --- # Tags > Part of mCSS (mcss.dev). Rendered page: https://mcss.dev/components/tags
    The `.tags` component styles a list of tags. It supports both list and inline layouts, is accessible by default, and customizable via CSS custom properties.
    | File | Description | Source | | -------------------- | ----------- | ----------- | | `component.tags.css` | All tags styles (`.tags`) | [Github][1] |
    [1]: https://github.com/minimaldesign/mCSS/blob/main/src/styles/framework/component.tags.css
    ## Playground
  • css
  • astro
  • basics
  • `} baseClasses="tags" controls={[ { heading: "Variation", items: [ { type: "select", name: "layout", label: "Layout", default: "", options: [ { label: "List", value: "" }, { label: "Inline", value: "tags-inline" }, ]}, ]}, ]} /> ## HTML ### Custom properties The following custom properties are available in [`settings.ui.css`](/docs/tokens#interface-tokens): | Property | Description | | ------------------------------- | --------------------------- | | `--tags-padding` | Tag padding. | | `--tags-font-size` | Tag font size. | | `--tags-color` | Tag text color. | | `--tags-background-color` | Tag background color. | | `--tags-background-color-hover` | Tag hover background color. | | `--tags-radius` | Tag border radius. | ### Available modifiers
    | Modifier | Description | | -------------- | ---------------------------- | | `.tags` | Default style (list layout). | | `.tags-inline` | Inline layout using flex. |
    ## Astro component
    | Prop | Type | Default | Description | | ------------- | ---------- | ----------- | ----------------------------------------------------------- | | `tagList` | `string[]` | `[]` | Array of tag strings to display. | | `variant` | `string` | `inline` | Inline or list layout. | | `url` | `string` | `/blog/tags` | Base URL to prepend to each tag. | | `sort` | `boolean` | `false` | Sort tags alphabetically; input order is preserved by default. | | `class` | `string` | `undefined` | Additional CSS classes, useful for [helper classes](/docs/helpers). | | `ariaLabel` | `string` | `'Tags'` | Accessible label for the tag list. | | `data-testid` | `string` | `'tags'` | Test ID for testing purposes. |
    ## Examples
    • ### Astro example (frontmatter metadata) ```astro --- import Tags from '../components/Tags.astro'; const { frontmatter } = Astro.props; --- ```
    • ### HTML example (list layout) ```html ```
    --- # Testimonial > Part of mCSS (mcss.dev). Rendered page: https://mcss.dev/components/testimonial The `.testimonial` component is a quote with attribution: a `figure` wrapping mCSS's already-styled `blockquote`, plus an [Avatar](/components/avatar) byline. Pure HTML and CSS.

    We deleted four hundred lines of utility classes the week we switched. The cascade does the work now.

    | File | Description | Source | | --------------------------------------- | ------------------------------------- | ----------- | | `component.testimonial.css` | Layout + byline styles | [Github][1] | | `elements.text.css` | The `blockquote` styling (dependency) | [Github][2] | | `Testimonial.astro`, `Avatar.astro` | The Astro components | [Github][3] | | `--testimonial-role-color` in `settings.ui.css` | Interface token | [Github][4] |
    [1]: https://github.com/minimaldesign/mCSS/blob/main/src/styles/framework/component.testimonial.css [2]: https://github.com/minimaldesign/mCSS/blob/main/src/styles/framework/elements.text.css [3]: https://github.com/minimaldesign/mCSS/tree/main/src/components [4]: https://github.com/minimaldesign/mCSS/blob/main/src/styles/framework/settings.ui.css ## Playground

    {quote}

    `} controls={[ { heading: "Content", items: [ { type: "text", name: "quote", label: "Quote", default: "We deleted four hundred lines of utility classes the week we switched." }, ]}, { heading: "Byline", items: [ { type: "text", name: "name", label: "Name", default: "Sonny Mueller" }, { type: "text", name: "role", label: "Role", default: "Design lead, Acme" }, { type: "text", name: "initials", label: "Initials", default: "SM" }, ]}, ]} /> ## HTML ```html

    We deleted four hundred lines of utility classes the week we switched.

    ``` ### Custom properties
    | Property | Description | | -------------------------- | ----------------- | | `--testimonial-role-color` | Role text color. |
    The quote itself is themed by the `blockquote` element styles. ## Astro component
    | Prop | Type | Default | Description | | ----------- | ------------------------- | ----------- | ------------------------------------------------ | | `name` | `string` | — | Who said it. Required (also feeds the Avatar initials when there is no photo). | | `role` | `string` | `undefined` | Title/company line. | | `avatarSrc` | `ImageMetadata \| string` | `undefined` | Photo for the Avatar. | | `class` | `string` | `undefined` | Additional CSS classes. |
    The default slot is the quote. ## Examples A wall of quotes is just testimonials on the [grid](/docs/global#grid):
    • The copy-paste model means I actually own my components.

      Readable class names. Imagine that.

      Shipped our marketing site in a weekend.

      ```astro --- import Testimonial from "../components/Testimonial.astro"; ---

      The copy-paste model means I actually own my components.

      ```
    --- # Table of Content > Part of mCSS (mcss.dev). Rendered page: https://mcss.dev/components/toc
    The `.toc` component is an "Astro only" client-side rendered component. It creates a table of content from the headings on the page it's on:
    By default, the TOC includes `H2`s and `H3`s (customizable via props) that have an ` id` attribute and links to them. It's possible to add multiple TOC on the same page, but this will duplicate Javascript and it's not recommended. If you do need to include more than one TOC, you'll need to add a unique `id` to each instance of the component.
    | File | Description | Source | | ------------------- | ----------- | ----------- | | `component.toc.css` | All TOC styles (`.toc`) | [Github][1] |
    [1]: https://github.com/minimaldesign/mCSS/blob/main/src/styles/framework/component.toc.css
    ## HTML This component's main functionality is to create a table of content via JavaScript. It just renders a nested `ul` and it's most useful as an Astro component. ### Custom properties The following custom properties are available in [`settings.ui.css`](/docs/tokens#interface-tokens): | Property | Color | | ------------------- | ------------------------- | | `--toc-color` | Links color. | | `--toc-color-hover` | Links hover color. | | `--toc-spacing` | Links padding. | | `--toc-icon-size` | Icon size. | | `--toc-indentation` | Nested lists indentation. | ## Astro component
    | Prop | Type | Default | Description | | -------------- | --------- | ------------- | ----------------------------------------------------------- | | `id` | `string` | `toc` | Needed to add more than one TOC. | | `selector` | `string` | `main` | HTML element to scan for headings. | | `headings` | `array` | `['h2','h3']` | Heading levels to include. | | `baseUrl` | `string` | `''` | Optional URL to prepend `#id` with. | | `scrollOffset` | `integer` | `0` | Scroll position offset from the top.. | | `description` | `string` | `undefined` | Text above the TOC. | | `icon` | `string` | `''` | Optional inline SVG. (See example.) | | `class` | `string` | `undefined` | Additional CSS classes, useful for [helper classes](/docs/helpers). |
    ## Examples
    • ### TOC with only H2s ```astro --- import Toc from "../../components/Toc.astro"; --- ```
    • ### TOC with H2 — h4 and a ♥︎ icon #### A H4 just as an example ```astro --- import heart from "../../assets/icons/arrow-right-small.svg?raw"; import Toc from "../../components/Toc.astro"; --- ```
    --- # Toggle > Part of mCSS (mcss.dev). Rendered page: https://mcss.dev/components/toggle The toggle is a [CSS-only component](/docs/start#components) using the `.toggle` class on `` elements of the type `checkbox`.
    | File | Description | Source | | ----------------- | ----------- | ----------- | | `component.toggle.css` | All toggle styles (`.toggle`) | [Github][1] |
    [1]: https://github.com/minimaldesign/mCSS/blob/main/src/styles/framework/component.toggle.css ## Playground '} baseClasses="toggle" controls={[ { heading: "State", items: [ { type: "checkbox", name: "checked", label: "Checked", attr: "checked", default: true }, { type: "checkbox", name: "disabled", label: "Disabled", attr: "disabled", default: false }, ]}, ]} /> ## HTML
    • ```html ```