m3-web-vanilla
Skill4 starsChanged 10 months agoApache-2.0View on GitHub
Implement Material Design 3 using only vanilla CSS custom properties and semantic classes. Zero dependencies. Use this when building M3-styled static sites, simple web apps, or when you need full control over every design token without a framework.
In this repository21 other files it gives its agents.
- AGENTS.mdAGENTS.md
- license-chooserSkill
- m3-web-androidSkill
- m3-web-angularSkill
- m3-web-flutterSkill
- m3-web-inkSkill
- m3-web-reactSkill
- m3-web-svelteSkill
- m3-web-tailwindSkill
- m3-web-vueSkill
- m3-web-webcomponentsSkill
- material-design-3-colorSkill
- material-design-3-componentsSkill
- material-design-3-guideSkill
- material-design-3-iconsSkill
- material-design-3-layoutSkill
- material-design-3-motionSkill
- material-design-3-shapeSkill
- material-design-3-typographySkill
- material-theme-builderSkill
- skill-creatorSkill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 2 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 19
When you need full control over every design token
- Distinctive: line 176
If you want M3 styling without writing all the CSS yourself:
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Material Design 3 — Vanilla CSS
Overview
Implement Material Design 3 using only CSS custom properties and semantic classes. No framework dependency. This is the canonical approach used by all other M3 skills in this repository.
Keywords: Material Design 3, M3, vanilla CSS, CSS custom properties, design tokens, Beer CSS, CSS framework, no framework
When to Use
- Static sites or simple web apps
- Any project where you want zero dependencies
- When you need full control over every design token
- As a reference implementation for other frameworks
- Rapid prototyping without build tools
Setup
Define M3 tokens as CSS custom properties:
/* m3-tokens.css */
:root {
/* Color tokens */
--md-sys-color-primary: #6750A4;
--md-sys-color-on-primary: #FFFFFF;
--md-sys-color-primary-container: #EADDFF;
--md-sys-color-on-primary-container: #21005D;
--md-sys-color-secondary: #625B71;
--md-sys-color-on-secondary: #FFFFFF;
--md-sys-color-tertiary: #7D5260;
--md-sys-color-on-tertiary: #FFFFFF;
--md-sys-color-error: #B3261E;
--md-sys-color-on-error: #FFFFFF;
--md-sys-color-surface: #FEF7FF;
--md-sys-color-on-surface: #1D1B20;
--md-sys-color-surface-variant: #E7E0EC;
--md-sys-color-on-surface-variant: #49454F;
--md-sys-color-outline: #79747E;
--md-sys-color-outline-variant: #CAC4D0;
/* Shape tokens */
--md-sys-shape-corner-none: 0px;
--md-sys-shape-corner-extra-small: 4px;
--md-sys-shape-corner-small: 8px;
--md-sys-shape-corner-medium: 12px;
--md-sys-shape-corner-large: 16px;
--md-sys-shape-corner-extra-large: 28px;
--md-sys-shape-corner-full: 9999px;
/* Typography tokens */
--md-sys-typescale-label-large-font: 'Roboto', sans-serif;
--md-sys-typescale-label-large-size: 14px;
--md-sys-typescale-label-large-weight: 500;
--md-sys-typescale-label-large-tracking: 0.1px;
--md-sys-typescale-body-medium-font: 'Roboto', sans-serif;
--md-sys-typescale-body-medium-size: 14px;
--md-sys-typescale-body-medium-weight: 400;
--md-sys-typescale-title-medium-font: 'Roboto', sans-serif;
--md-sys-typescale-title-medium-size: 16px;
--md-sys-typescale-title-medium-weight: 500;
}
/* Dark theme */
[data-theme="dark"] {
--md-sys-color-primary: #D0BCFF;
--md-sys-color-on-primary: #381E72;
--md-sys-color-surface: #141218;
--md-sys-color-on-surface: #E6E0E9;
--md-sys-color-surface-variant: #49454F;
--md-sys-color-on-surface-variant: #CAC4D0;
--md-sys-color-outline: #938F99;
}Component Examples
Filled Button
.md3-button-filled {
background: var(--md-sys-color-primary);
color: var(--md-sys-color-on-primary);
border: none;
border-radius: var(--md-sys-shape-corner-full);
padding: 10px 24px;
font-family: var(--md-sys-typescale-label-large-font);
font-size: var(--md-sys-typescale-label-large-size);
font-weight: var(--md-sys-typescale-label-large-weight);
letter-spacing: var(--md-sys-typescale-label-large-tracking);
cursor: pointer;
min-height: 40px;
position: relative;
overflow: hidden;
}
.md3-button-filled:hover::before {
content: '';
position: absolute;
inset: 0;
background: var(--md-sys-color-on-primary);
opacity: 0.08;
}
.md3-button-filled:disabled {
background: color-mix(in srgb, var(--md-sys-color-on-surface) 12%, transparent);
color: color-mix(in srgb, var(--md-sys-color-on-surface) 38%, transparent);
cursor: default;
}Card
.md3-card-elevated {
background: var(--md-sys-color-surface);
border-radius: var(--md-sys-shape-corner-medium);
padding: 16px;
box-shadow: 0 1px 2px rgba(0,0,0,0.3), 0 1px 3px 1px rgba(0,0,0,0.15);
}
.md3-card-filled {
background: var(--md-sys-color-surface-variant);
border-radius: var(--md-sys-shape-corner-medium);
padding: 16px;
}
.md3-card-outlined {
background: var(--md-sys-color-surface);
border: 1px solid var(--md-sys-color-outline-variant);
border-radius: var(--md-sys-shape-corner-medium);
padding: 16px;
}Text Field
.md3-text-field-outlined {
position: relative;
border: 1px solid var(--md-sys-color-outline);
border-radius: var(--md-sys-shape-corner-extra-small);
padding: 16px;
font-family: var(--md-sys-typescale-body-medium-font);
font-size: var(--md-sys-typescale-body-medium-size);
background: transparent;
color: var(--md-sys-color-on-surface);
}
.md3-text-field-outlined:focus {
border-color: var(--md-sys-color-primary);
border-width: 2px;
outline: none;
}<button class="md3-button-filled">Click me</button>
<div class="md3-card-elevated">
<h3 style="font-family: var(--md-sys-typescale-title-medium-font)">Title</h3>
<p style="font-family: var(--md-sys-typescale-body-medium-font)">Content</p>
</div>
<input class="md3-text-field-outlined" placeholder="Email" />CSS-only Frameworks
If you want M3 styling without writing all the CSS yourself:
- Beer CSS (
beercss): First CSS framework fully based on M3. Zero dependencies, semantic HTML, very small bundle. https://www.beercss.com/ - Material Design Light: Lightweight SCSS framework compiled to plain CSS. https://github.com/mdlightdev/material-design-light
- GMX.css: Minimal-JS M3 CSS implementation with predefined color schemes. https://www.cssscript.com/material-design-framework-gmx/
Checklist
- All M3 color tokens defined as CSS custom properties
- Dark theme variant using
[data-theme="dark"]orprefers-color-scheme - Shape tokens use the M3 shape scale
- Typography tokens follow the M3 type scale
- Components use semantic token names (not hard-coded hex)
- Interaction states (hover, focus, pressed, disabled) implemented
- Touch targets meet 48×48dp minimum
- Focus indicators visible with adequate contrast
Resources
m3-tokens.css— Complete M3 token foundation (color, shape, typography, motion, spacing, elevation) included in this skill's directory. Copy into your project as a starting point.material-theme-builderskill — Generate a custom token set from any source color.- Material Theme Builder: https://material-foundation.github.io/material-theme-builder/
- M3 Design Tokens: https://m3.material.io/foundations/design-tokens/overview
- Beer CSS: https://www.beercss.com/
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

