website-design-system
Skill6 starsChanged 56 days agoMITView on GitHub
The visual build standards for a new site: mobile-first responsive graphics (WebP/AVIF, sized-to-display, srcset, lazy-load, descriptive alt, no layout shift), dark mode (CSS-variable theme tokens + a no-FOUC script + WCAG AA contrast in BOTH themes), and the brand/theme token block that BRAND.md mirrors. Use when building or reviewing layout, images, theming, or BRAND.md (step 5 of the new-website pipeline). Contrast is enforced by a11y.spec.ts (light+dark). Trigger phrases: "dark mode", "theme toggle", "responsive images", "mobile optimization", "image optimization", "WebP", "layout shift", "CLS", "design system", "theme tokens", "brand colors", "BRAND.md".
In this repository33 other files it gives its agents.
- skills/new-website/templates/AGENTS.mdAGENTS.md
- skills/new-website/templates/CLAUDE.mdCLAUDE.md
- ai-seoSkill
- astro-i18n-setupSkill
- business-listings-setupSkill
- copywritingSkill
- customer-researchSkill
- double-knuthSkill
- imageSkill
- independent-reviewSkill
- internal-link-auditSkill
- keystatic-setupSkill
- new-websiteSkill
- og-imagesSkill
- outgoing-link-auditSkill
- schema-markupSkill
- search-console-insightsSkill
- search-console-setupSkill
- seo-auditSkill
- seo-repositionSkill
- site-architectureSkill
- website-content-guideSkill
- website-motionSkill
- website-permissionsSkill
- website-positioning-checkSkill
- website-positioningSkill
- website-qaSkill
- website-reviewSkill
- website-scorecardSkill
- website-seo-geoSkill
- website-storySkill
- website-team-setupSkill
- website-testimonialsSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 1 is distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 26
Tokens, not hard-coded colours: All colour flows through CSS custom properties.
- Distinctive: line 33
Contrast both themes: every text/background pair passes WCAG AA (4.5:1 body, 3:1 large/UI).
- Very specific: line 42
Size to display, not source: Never ship a 2000px image into an 80px slot.
- Very specific: line 60
Prefer flexible widths: Use min-width / flex / grid auto/fr sizing for any element holding translated text, not a fixed width sized to the …
- Very specific: line 78
Never put a plaintext email or mailto:your@addr in the HTML source — scrapers harvest it for spam within hours.
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 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
Website design system
Owns the how it looks and performs visually layer: mobile graphics, dark
mode, and the theme tokens. Outputs/maintains BRAND.md (template in
~/.claude/skills/new-website/templates/brand.md) and the token block in
~/.claude/skills/new-website/templates/astro/src/styles/global.css. Image rules
are below (WebP/AVIF via Astro's astro:assets); the images.spec.ts test
enforces them. For generating image assets, use the image skill.
Dark mode (first-class)
- Tokens, not hard-coded colours. All colour flows through CSS custom
properties; light is the
:rootdefault, dark overrides under:root[data-theme="dark"], plus a@media (prefers-color-scheme: dark)block for no-JS visitors. The starter ships this exact structure. - No-FOUC script in
<head>setsdata-themefromlocalStorage.themeor the system preference before first paint (already wired inBase.astro). The toggle writeslocalStorage.theme. - Contrast both themes: every text/background pair passes WCAG AA (4.5:1 body, 3:1 large/UI). A colour that passes in light often fails in dark — the a11y test runs the full light+dark matrix, so check both.
Mobile & responsive graphics
- Mobile first: design from 360px up; tap targets ≥ 44px; no horizontal scroll. Verify at 360 / 768 / 1280 (preview_resize).
- Modern formats: WebP (or AVIF) over JPEG/PNG for photos.
- Size to display, not source. Never ship a 2000px image into an 80px slot;
generate width variants and use
srcset/sizes(or<picture>). - No layout shift: set explicit
width/heightattributes so the box is reserved before the image loads (protects CLS / LCP). Astro's<Image>sets them automatically;images.spec.tsrequires the attributes (a CSS-only aspect-ratio will not satisfy the test). - Lazy vs eager:
loading="lazy"below the fold; the LCP/hero image loads eager withfetchpriority="high"(do NOT lazy-load it). - Alt text on every image (
alt=""only if purely decorative). - Fonts: self-host woff2 with
font-display: swap; preload only the 1–2 used above the fold. Avoid layout shift from late font swaps.
Text-length responsiveness (translated copy)
- Translated text runs longer. German (and many other languages) commonly runs 20–35% longer than the equivalent English copy. A button, nav link, or card sized to fit English placeholder text will silently overflow, wrap ugly, or truncate the moment real translated copy replaces it.
- Prefer flexible widths. Use
min-width/ flex / gridauto/frsizing for any element holding translated text, not a fixedwidthsized to the English string. - Overflow ≠ width: flexible sizing doesn't stop a SINGLE long compound noun
(
Datenschutzerklärung) from bursting a narrow column — that needshyphens: auto(correct per-language via thelangattribute Base.astro already sets) plusoverflow-wrap: break-wordas the fallback; the starter'sglobal.cssships both onbody. - Don't rely on
white-space: nowrap+text-overflow: ellipsisalone as the handling for nav links or button labels — truncating a nav link is usually not acceptable UX (the visitor can no longer tell where it goes). Fine for content where truncation is an accepted tradeoff (e.g. a table cell), not for navigation. - Verify with real translated labels, not English placeholders. When a site ships
astro-i18n-setup'sLanguageSwitcher.astroor any bilingual/multilingual nav, check layout at 360/768/1280 (preview_resize) using the actual shipped copy in every language — not just the English placeholder.
Email obfuscation (hide addresses from crawlers)
Never put a plaintext email or mailto:your@addr in the HTML source — scrapers harvest it
for spam within hours. Render every address through the EmailLink.astro component
(~/.claude/skills/new-website/templates/astro/src/components/EmailLink.astro + its
lib/obfuscate.ts helper): the address is reversed + base64-encoded at build time and
reassembled in the browser, so the served HTML contains no readable address. No-JS visitors
see a still-usable "name [at] domain [dot] com" hint.
<EmailLink address="hello@example.com" subject="Project enquiry" text="Email us" />Rule: zero raw mailto: links and zero literal @-addresses in built HTML — website-qa
checks this. Same idea for any phone number you don't want harvested.
Brand tokens
Mirror BRAND.md's palette into the token block and keep them in sync. Define:
brand/accent (fixed), and per-theme heading/ink/muted/line/bg/surface. The accent
used for links must pass AA on the background in both themes.
Done means
BRAND.md filled and consistent with the token block; images are WebP, sized,
lazy/eager-correct, with alt; the a11y test (light+dark) is green; layout holds
at 360/768/1280 with no shift. Perf numbers (FCP/LCP) are verified in website-qa.
Layout also holds at 360/768/1280 with real (not placeholder) copy in every
shipped language, not just the default locale.
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.

