### Install dependencies and start development server
Source: https://github.com/yummacss/docs/blob/main/README.md
Run these commands from the project root to set up the docs site in development mode. `pnpm i` installs dependencies, and `pnpm d` starts both the Next.js dev server and Yumma CSS in watch mode.
```bash
# install dependencies
pnpm i
# start development
pnpm d
```
--------------------------------
### Install Oxlint Plugin
Source: https://github.com/yummacss/docs/blob/main/src/content/docs/configuration.mdx
Install the Oxlint plugin and the Yumma CSS lint rules.
```bash
pnpm add -D oxlint @yummacss/lint
```
--------------------------------
### Configure Rule Options
Source: https://github.com/yummacss/docs/blob/main/src/content/docs/configuration.mdx
Example of configuring `allow` and `message` options for a rule in `.oxlintrc.json`.
```json
{
"rules": {
"yummacss/no-unknown-classes": ["error", {
"allow": ["brand-logo", "editor-*"],
"message": "{{className}} is not on the scale. Did you mean {{suggestions}}?"
}]
}
}
```
--------------------------------
### Install Yumma CSS with PostCSS plugin
Source: https://github.com/yummacss/docs/blob/main/src/content/docs/installation.mdx
Install the yummacss package and the @yummacss/postcss plugin as dev dependencies using pnpm.
```bash
pnpm add yummacss @yummacss/postcss -D
```
--------------------------------
### Install Yumma CSS with Vite plugin
Source: https://github.com/yummacss/docs/blob/main/src/content/docs/installation.mdx
Install the yummacss package and the @yummacss/vite plugin as dev dependencies using pnpm.
```bash
pnpm add yummacss @yummacss/vite -D
```
--------------------------------
### Animate out with starting style and state
Source: https://github.com/yummacss/docs/blob/main/src/content/docs/states.mdx
Pairs the starting style and a custom state to animate a popup out. The example uses @st:o:0 and closing:o:0.
```tsx
Settings
```
--------------------------------
### Create a Vite project
Source: https://github.com/yummacss/docs/blob/main/src/content/ui/installation.mdx
Use this command to scaffold a new React + TypeScript project with Vite. This is the first step in the installation workflow.
```bash
pnpm create vite my-app --template react-ts
```
--------------------------------
### Install the Yumma CSS skill with npx
Source: https://github.com/yummacss/docs/blob/main/src/content/docs/agents.mdx
Installs the Yumma CSS and Yumma UI skill for agents that load skills, such as Claude Code. The rules are read from the site each time, so they never go stale.
```bash
npx skills add yummacss/yummacss
```
--------------------------------
### Class name mapping examples
Source: https://github.com/yummacss/docs/blob/main/src/content/docs/naming-convention.mdx
Shows how CSS declarations map to Yumma CSS class names using initials.
```markdown
display: flex; /* d:f */
justify-content: space-between; /* jc:sb */
text-transform: uppercase; /* tt:u */
```
--------------------------------
### Add a component with yummaui add
Source: https://github.com/yummacss/docs/blob/main/src/content/ui/installation.mdx
Run this command to add a component (e.g., button) to your project. Any npm dependencies, such as @base-ui/react, are installed automatically.
```bash
pnpm dlx yummaui add button
```
--------------------------------
### yumma.config.mjs example
Source: https://github.com/yummacss/docs/blob/main/src/content/ui/installation.mdx
This is the configuration file that init writes. It defines states, easings, keyframes, and colors used by the components. If a config already exists, init and add only add missing parts and preserve existing definitions.
```js
import { defineConfig } from "yummacss";
export default defineConfig({
source: ["./src/**/*.{js,jsx,ts,tsx,mdx}"],
theme: {
states: {
closing: "[data-ending-style]",
"from-left": "[data-activation-direction=left]",
"from-right": "[data-activation-direction=right]",
hovering: "[data-hovering]",
opening: "[data-starting-style]",
scrolling: "[data-scrolling]",
swiping: "[data-swiping]",
},
easings: {
"in-out-cubic": "cubic-bezier(0.65, 0, 0.35, 1)",
"out-back": "cubic-bezier(0.34, 1.56, 0.64, 1)",
"out-quart": "cubic-bezier(0.25, 1, 0.5, 1)",
},
keyframes: {
pulse: "0%, 100% { opacity: .5; } 50% { opacity: 1; }",
slide: "from { translate: -100% 0; } to { translate: 100% 0; }",
spin: "to { rotate: 360deg; }",
},
colors: {
raised: { light: "#ffffff", dark: "#2d2f33" },
well: { light: "#eff0f2", dark: "#18191b" },
field: { light: "#ffffff", dark: "#18191b" },
fill: { light: "#1e232a", dark: "#e6e9ec" },
"on-fill": { light: "#ffffff", dark: "#1e232a" },
label: { light: "#1e232a", dark: "#ececee" },
hint: { light: "#64748b", dark: "#9a9ca3" },
rim: { light: "#d1d5dc", dark: "#424447" },
shadow: { light: "#a5aebc", dark: "#0a0a0b" },
line: { light: "#e1e3e7", dark: "#2f3032" },
check: { light: "#2563eb", dark: "#2563eb" },
on: { light: "#10b981", dark: "#10b981" },
knob: { light: "#ffffff", dark: "#e6e9ec" },
groove: { light: "#c4c9d1", dark: "#08090a" },
glint: { light: "#ffffff", dark: "#4f5258" },
focus: { light: "#7a879b", dark: "#8f9bab" },
},
},
});
```
--------------------------------
### Install Yumma CLI with pnpm
Source: https://github.com/yummacss/docs/blob/main/src/content/docs/configuration.mdx
Adds the Yumma CSS package as a dev dependency, which includes the Yumma CLI for generating production-ready styles.
```bash
pnpm add yummacss -D
```
--------------------------------
### Fade & Grow with @st:o:0 and @st:s:90
Source: https://github.com/yummacss/docs/blob/main/src/content/docs/starting-style.mdx
Stack multiple starting values to animate both opacity and scale. Use a transition property that covers each property.
```tsx
Settings
```
--------------------------------
### Mobile-first breakpoint example with @sm: prefix
Source: https://github.com/yummacss/docs/blob/main/src/content/docs/media-queries.mdx
Shows how to apply a utility from a breakpoint up. The first line is deleted (del={1}) and the second is inserted (ins={2}), demonstrating a change from center-aligned text on small screens to left-aligned from the @sm breakpoint upward.
```tsx
Good evening!
Good evening!
```
--------------------------------
### Animate In with @st:o:0
Source: https://github.com/yummacss/docs/blob/main/src/content/docs/starting-style.mdx
Use `@st:o:0` to set the starting opacity to 0 for an element that appears. The element renders at opacity 0, then transitions to its normal opacity over 150ms.
```tsx
Saved to Documents
```
```css
@starting-style {
.\@st\:o\:0 {
opacity: 0;
}
}
```
--------------------------------
### Negative Z-Index Example
Source: https://github.com/yummacss/docs/blob/main/src/content/docs/negative-values.mdx
Use `zi:-10` to place an element behind its siblings or parents.
```tsx
Background Layer
```
--------------------------------
### Stacking container query with @c:md:h:o:80
Source: https://github.com/yummacss/docs/blob/main/src/content/docs/container-queries.mdx
A container query stacks with any other variant, like every at-rule. This example shows a class that combines an opacity utility with a container-query variant that sets opacity to 80% at the `md` container width.
```tsx
Open folder
```
--------------------------------
### With Breakpoints using @md:@st:o:0
Source: https://github.com/yummacss/docs/blob/main/src/content/docs/starting-style.mdx
Nest the `@st:` at-rule inside a breakpoint to apply starting styles only at certain viewport sizes.
```tsx
```
```css
@media (min-width: 48rem) {
@starting-style {
.\@md\:\@st\:o\:0 {
opacity: 0;
}
}
}
```
--------------------------------
### Negative Positioning Example
Source: https://github.com/yummacss/docs/blob/main/src/content/docs/negative-values.mdx
Use `t:-4` and `l:-4` to position an element outside its parent.
```tsx
```
--------------------------------
### Read utility definitions from @yummacss/core
Source: https://github.com/yummacss/docs/blob/main/src/content/docs/installation.mdx
Import `boxModelUtils` and `coreUtils` from `@yummacss/core` to get utility definitions. `boxModelUtils()` returns box model utilities, and `coreUtils()` returns every utility definition.
```js
import { boxModelUtils, coreUtils } from "@yummacss/core";
const boxModel = boxModelUtils();
const everything = coreUtils();
```
--------------------------------
### Define a state in yumma.config.mjs
Source: https://github.com/yummacss/docs/blob/main/src/content/docs/states.mdx
Add custom state selectors to the theme.states object. The example defines 'closing' and 'open' states that map to attribute selectors.
```mjs
import { defineConfig } from "yummacss";
export default defineConfig({
theme: {
states: {
closing: "[data-ending-style]",
open: "[open]",
},
},
});
```
--------------------------------
### HTML Input with Yumma CSS classes
Source: https://github.com/yummacss/docs/blob/main/src/content/docs/configuration.mdx
Example of an HTML element using Yumma CSS utility classes. The CLI scans files in the `source` config to generate CSS.
```tsx
```
--------------------------------
### Use custom breakpoint @3xl:d:b
Source: https://github.com/yummacss/docs/blob/main/src/content/docs/media-queries.mdx
Applies the custom '3xl' breakpoint to set display to block from that width up. This example is part of the 'Use Custom Breakpoints' step and relies on the config file created in the previous step.
```tsx
```
--------------------------------
### Button with className for width
Source: https://github.com/yummacss/docs/blob/main/src/content/ui/customization.mdx
Every component takes className and merges it into its own classes. This example adds a width that the component does not set.
```tsx
```
--------------------------------
### Negative Margin Example
Source: https://github.com/yummacss/docs/blob/main/src/content/docs/negative-values.mdx
Use `ml:-4` to apply a negative left margin of -1rem, useful for overlapping elements.
```tsx
A
B
C
```
--------------------------------
### Badge with tone, color, size, and shape props
Source: https://github.com/yummacss/docs/blob/main/src/content/ui/customization.mdx
Use props to style components. The component applies the prop itself. This example shows a Badge with tone, color, size, and shape props.
```tsx
Shipped
```
--------------------------------
### Configure PostCSS plugin with cwd option
Source: https://github.com/yummacss/docs/blob/main/src/content/docs/installation.mdx
Pass the `cwd` option to the PostCSS plugin to set the base directory for resolving config and source globs. The example uses `import.meta.dirname`.
```js
export default {
plugins: {
"@yummacss/postcss": { cwd: import.meta.dirname },
},
};
```
--------------------------------
### Dialog with focus prop
Source: https://github.com/yummacss/docs/blob/main/src/content/ui/customization.mdx
Use the focus prop to style the focus outline. This example sets the outline color with fv:oc:blue-2/60.
```tsx
```
--------------------------------
### Configure Custom Colors
Source: https://github.com/yummacss/docs/blob/main/src/content/docs/color-system.mdx
Extend or override the default palette using the `theme.colors` configuration option. This example adds a new color family and overrides the default blue.
```mjs
import { defineConfig } from "yummacss";
export default defineConfig({
theme: {
colors: {
background: "#f5f6f7", // add new color family
blue: "#1a73e8", // overrides the default blue.
},
},
});
```
--------------------------------
### Using keyframes with animation utilities
Source: https://github.com/yummacss/docs/blob/main/src/content/docs/animation-name.mdx
Combine a keyframe name with animation duration, timing function, and iteration count. The example shows a spinning element with a 700ms duration, linear timing, and infinite iteration. The output CSS includes the keyframes only if used.
```tsx
```
```css
.an\:spin {
animation-name: spin;
}
@keyframes spin {
to { rotate: 360deg; }
}
```
--------------------------------
### Build the docs site
Source: https://github.com/yummacss/docs/blob/main/README.md
Run `pnpm build` to build the documentation site for production.
```bash
pnpm build
```
--------------------------------
### Initialize a yummaui project
Source: https://github.com/yummacss/docs/blob/main/src/content/ui/configuration.mdx
Run this command to detect your framework, package manager, and import alias, then prompt for where components live. Use --force to replace an existing yummaui.json, or -y/--yes to skip prompts and take defaults.
```bash
pnpm dlx yummaui init
```
--------------------------------
### List components
Source: https://github.com/yummacss/docs/blob/main/src/content/ui/configuration.mdx
Prints every component.
```bash
pnpm dlx yummaui list
```
--------------------------------
### Add components with yummaui
Source: https://github.com/yummacss/docs/blob/main/src/content/ui/configuration.mdx
Copies one or more components in. With no names, it opens a list to search and pick from. Options include -a/--all to add every component, --style (soft, compact, squircle), --radius (none, small, medium, large, extra), --overwrite to replace existing files, and -y/--yes to skip prompts.
```bash
pnpm dlx yummaui add button
```
```bash
pnpm dlx yummaui add dialog tooltip
```
```bash
pnpm dlx yummaui add
```
```bash
pnpm dlx yummaui add --all
```
```bash
pnpm dlx yummaui add button --style compact --radius small
```
--------------------------------
### Initialize Yumma configuration
Source: https://github.com/yummacss/docs/blob/main/src/content/docs/configuration.mdx
Creates a yumma.config.mjs file at the project root, which is read by the CLI and both plugins.
```bash
pnpm dlx yummacss init
```
--------------------------------
### Register PostCSS plugin in postcss.config.mjs
Source: https://github.com/yummacss/docs/blob/main/src/content/docs/installation.mdx
Add the @yummacss/postcss plugin to your PostCSS configuration. Works with Next.js and any PostCSS setup.
```mjs
export default {
plugins: {
"@yummacss/postcss": {},
},
};
```
--------------------------------
### Create a Next.js project
Source: https://github.com/yummacss/docs/blob/main/src/content/ui/installation.mdx
Use this command to scaffold a new Next.js project. This is an alternative to the Vite command, depending on your framework choice.
```bash
pnpm create next-app@latest my-app
```
--------------------------------
### Inline Style with Custom Property
Source: https://github.com/yummacss/docs/blob/main/src/content/docs/configuration.mdx
Example of using a custom property in a style object; `no-inline-styles` skips custom properties.
```tsx
```
--------------------------------
### Responsive display utilities with breakpoint prefixes
Source: https://github.com/yummacss/docs/blob/main/src/content/docs/media-queries.mdx
Shows how to show different text for each breakpoint range. Each paragraph uses a combination of 'd:none' and 'd:b' with breakpoint prefixes to control visibility from small to extra-large screens.
```tsx
Small screen
Medium screen
Large screen
Extra large screen
Double extra large screen
```
--------------------------------
### Build Command
Source: https://github.com/yummacss/docs/blob/main/src/content/docs/configuration.mdx
Compile Yumma CSS files once. Requires a `yumma.config.mjs` file; run `yummacss init` if missing.
```bash
pnpm dlx yummacss build
```
--------------------------------
### Letter Spacing Sign Toggle Example
Source: https://github.com/yummacss/docs/blob/main/src/content/docs/negative-values.mdx
Use `ls:-1` to flip the negative letter-spacing value to a positive one, making spacing wider.
```tsx
Standard (Tight)
Negated (Wide)
```
--------------------------------
### Button with focus disabled
Source: https://github.com/yummacss/docs/blob/main/src/content/ui/customization.mdx
Set focus={false} to remove the focus outline and its danger, error, and success tints. This example also adds a background class.
```tsx
```
--------------------------------
### Append agents.md to AGENTS.md with curl
Source: https://github.com/yummacss/docs/blob/main/src/content/docs/agents.mdx
Saves the rules file as the instructions file your agent reads, typically AGENTS.md at the project root. Appends so existing instructions stay.
```bash
curl -s https://www.yummacss.com/agents.md >> AGENTS.md
```
--------------------------------
### Example of conflicting classes in JSX
Source: https://github.com/yummacss/docs/blob/main/src/content/docs/class-merge.mdx
Shows two spans with the same classes in different orders, both rendering white because `c:white` is generated after `c:accent` in the stylesheet.
```tsx
AccentAccent
```
--------------------------------
### Reduced motion variant
Source: https://github.com/yummacss/docs/blob/main/src/content/docs/animation-name.mdx
Use the `@prm:` variant to stop an animation for users who prefer reduced motion. The example applies `an:none` to override the spin animation.
```tsx
```
--------------------------------
### Media queries work the same way
Source: https://github.com/yummacss/docs/blob/main/src/content/docs/class-merge.mdx
Shows that media query variants are compared within their own variant, so `@lg:p:8` overrides `@lg:p:4` but not `p:2`.
```tsx
merge("@lg:p:4 p:2", "@lg:p:8"); // "p:2 @lg:p:8"
```
--------------------------------
### Button with className overriding color
Source: https://github.com/yummacss/docs/blob/main/src/content/ui/customization.mdx
className overrides component classes via merge. This example uses c:accent to override the component's default color.
```tsx
```
--------------------------------
### Registry endpoints
Source: https://github.com/yummacss/docs/blob/main/src/content/ui/configuration.mdx
Static JSON published by this site. Point 'registry' at your own copy to serve components from somewhere else.
```text
https://yummacss.com/ui/registry/index.json every component, and the theme they animate with
https://yummacss.com/ui/registry/.json one component's source and dependencies
https://yummacss.com/ui/registry/styles.json the styles and the radius steps each takes
https://yummacss.com/ui/registry/