Communitygithub.com

frogg435/frontend-design-styles

An assistant for faithfully implementing and restoring frontend UI design styles, covering Xiaomi MIUIX/HyperOS, Apple HIG, Google Material Design 3, and Microsoft Fluent 2. Use it when users request a specific design style for pages or components, need an iOS-style interface, a Material Design 3 admin panel, a Windows 11-style desktop app, or a HyperOS/MIUI-style app, or when selecting, comparing, generating design tokens (colors, type scales, corner radii, shadows, motion, spacing) and outputting runnable frontend code (HTML/CSS/JS, React, Vue, Tailwind, Compose/Kotlin mappings). Also used for reviewing existing interfaces against a given design language.

What is frontend-design-styles?

This skill is a specialized assistant for frontend developers and designers who need to accurately implement UI interfaces following one of four major design languages: Xiaomi MIUIX/HyperOS, Apple HIG, Google Material Design 3, and Microsoft Fluent 2. It goes beyond superficial resemblance by enforcing a three-layer consistency of semantic tokens, component patterns, and motion curves, ensuring the output is instantly recognizable as belonging to a specific platform. The skill provides a step-by-step workflow: first, it helps confirm or recommend the design style; second, it reads the full token specification from reference documents before writing any code; third, it applies pre-built CSS token files for light and dark themes; fourth, it builds components according to the style's defined patterns; and finally, it adds motion effects and performs automated linting and a manual checklist. Key constraints include never mixing styles (e.g., using iOS blue in a Fluent component), using CSS custom properties (`var(--)`) instead of hardcoded values, implementing both light and dark themes, respecting platform-specific conventions (like iOS 44pt minimum touch target), maintaining accessibility contrast ratios, and handling Chinese typography correctly. The skill supports output as single-file HTML, or framework-specific code (Tailwind, React, Vue, Compose) via mapping rules.

Works with~Claude Code~Codex CLI~Cursor
npx skills add frogg435/frontend-design-styles

Ask in your favorite AI

Open a new chat with this agent skill pre-loaded.

Documentation

Frontend Design Styles

Accurately implement the four mainstream design languages into frontend code. The core goal is not "looks similar" but to achieve faithful restoration at three layers: semantic tokens + component patterns + motion curves, so the result is recognized by platform users as "This is iOS / This is Material / This is Windows."

When to Use / Not Use

Use: Generate or modify interfaces in a specified design style; compare and select among the four styles; produce design tokens and theme files; perform visual reviews against a design language.

Don't Use: The user has no style preference and just wants a "nice-looking page" → First ask if they want a specific style, or follow the recommendation logic in references/style-router.md; pure backend/algorithm tasks are unrelated to this skill.

Quick Reference of the Four Style Fingerprints

These are the most distinguishable features. Before implementing anything, review this table, and check the corresponding reference for details.

| | MIUIX / HyperOS | Apple HIG | Material Design 3 | Fluent 2 | |---|---|---|---| | Primary Color | #3482FF (Light) / #277AF7 (Dark) | #007AFF / #0A84FF | Role-based, baseline #6750A4 | #0F6CBD | | Font | MiSans | SF Pro (<20pt Text, ≥20pt Display) | Roboto / Roboto Flex | Segoe UI Variable | | Body Base Size | 16–17px | 17pt | 16sp (body-large) | 14px (body-1) | | Corner Radius Language | 16dp uniform radius + squircle (same origin as iOS, buttons not pill-shaped) | Continuous curvature (squircle), containers 10–20pt | 12dp cards / 28dp FAB & dialogs / fully round buttons | Small radii: controls 4px, dialogs 8px, nested -2px | | Layering Technique | Color scale layering (#FFFFFF / #F7F7F7 / #E8E8E8), almost no heavy shadows | Material blur (translucency) + grouped lists + content over UI | Tonal overlay prioritized, shadows secondary | Materials (Mica / Acrylic) + subtle multi-layer shadows | | Motion | Light, with spring bounce, 200–300ms | Spring physics, 200–300ms, no linear | Emphasized curve cubic-bezier(0.2,0,0,1), graded by duration tokens | Fast and restrained, 150–250ms, easyEase | | Touch/Click Target | ≥ 48dp | ≥ 44×44pt | ≥ 48dp | Control height 32px (compact/comfortable mode) | | One-sentence Vibe | Rounded, translucent, blue tech feel | Restrained, white space, content-first | Strong color expressiveness, layering via tones | Productivity, clarity, desktop-native |

Workflow

Step 1 · Determine Style. User has specified → use directly. Not specified → read references/style-router.md, and based on product type/platform/density, recommend 1 primary + 1 alternate style, then ask the user to confirm.

Step 2 · Read Tokens. Open the corresponding reference document and read all colors, type scales, spacing, corner radii, shadows, and motion before writing any code. Do not rely on memory:

  • MIUIX / HyperOS → references/miuix-hyperos.md
  • Apple HIG → references/apple-hig.md
  • Material Design 3 → references/material-design-3.md
  • Fluent 2 → references/fluent-2.md

Step 3 · Apply Tokens. Copy assets/tokens/<style>.css directly as the semantic token layer (already includes light/dark themes). Do not write hex values into component styles. Dark mode is toggled via [data-theme="dark"] or prefers-color-scheme.

Step 4 · Build Components. Implement components according to the style's specifications in references/components-playbook.md (button variants, inputs, cards, navigation, overlays, switches, list). Every interactive state (hover / focus / pressed / selected / disabled) must be included, not just the default state.

Step 5 · Add Motion + Self-check. Add transitions based on references/motion-and-accessibility.md, then run python3 scripts/lint_tokens.py <output> --style <style>, and go through the self-check checklist (below) item by item.

Hard Rules

  1. No mixing styles. If Fluent is selected, do not use iOS #007AFF, Material pill FAB, or HyperOS large-radius cards. Mixing is the most common failure mode.
  2. Tokens first. Component CSS should only contain var(--xxx). No literal color, font-size, or corner-radius values are allowed.
  3. Light and dark themes together. All four systems have official dark values; look them up directly. Do not use filter: invert or manually darken colors.
  4. Platform conventions are non-negotiable. For example, iOS minimum touch area 44pt, Material state layer opacity, Fluent control 1px bottom stroke, HyperOS dark background #242424 (not pure black surface).
  5. Accessibility is a hard requirement. Body text contrast ≥ 4.5:1, UI elements ≥ 3:1, focus ring must be visible, respect prefers-reduced-motion.
  6. Chinese typography must be handled separately. Roboto / Segoe UI / SF Pro lack complete Chinese glyphs. Chinese interfaces must fall back to Chinese fonts like PingFang / Source Han Sans / MiSans and reduce letter-spacing (Latin tracking does not apply to Chinese).

Delivery Specification

  • Default output is a single-file runnable HTML (inline <style> + <script>), with tokens organized as :root CSS variables for easy preview and copy.
  • Switch to framework-specific output only when the user specifies it, using mapping rules in references/framework-mappings.md: Tailwind uses assets/mappings/tailwind.css; React/Vue use token objects + CSS variables; Compose prefers official libraries (MIUIX uses MiuixTheme, M3 uses MaterialTheme).
  • A component demo page can be based on assets/templates/showcase.html (side-by-side presentation of the same components in all four styles, with theme and dark mode toggles).
  • Must run validation after output: python3 scripts/lint_tokens.py <output file> --style <style>. Fix any failures in the three checks (hardcoded colors / contrast / core tokens) before delivery.
  • When delivering, explain: which system was used, any deliberate deviations, how dark mode is toggled, and the font fallback stack.

Self-check Checklist

Check each item after completion; fix any failures:

  • All colors come from tokens, no hardcoded hex
  • Type scale does not exceed 4 levels, base body font size matches the system
  • Corner radius system is self-consistent (nested radius = outer radius − inner padding)
  • Shadow/material usage matches the system (Material uses tonal overlay, Fluent uses Mica/Acrylic, iOS uses blur materials, HyperOS uses color scale)
  • All interactive states present: hover / focus-visible / active / disabled / selected
  • Both light and dark themes verified
  • Touch target sizes meet requirements
  • Contrast ratios met, focus ring visible
  • prefers-reduced-motion degrades animations
  • Chinese font fallback correct, letter-spacing adjusted
  • No cross-system contamination

Reference Files

FileContent
references/style-router.mdFour-style selection decision tree, comparison matrix, mixing forbidden zones
references/miuix-hyperos.mdMIUIX full token table + HyperOS visual characteristics + component specifications
references/apple-hig.mdSystem colors full table + Dynamic Type 12 levels + materials + component specs
references/material-design-3.md29 color roles full light/dark table + 15-level type scale + shapes/elevation/state layers
references/fluent-2.mdNeutral/brand color ramps + Type Ramp + control dimensions + Mica/Acrylic + shadow tokens
references/components-playbook.mdPer-style component implementation specs for buttons/inputs/cards/navigation/overlays/switches/lists
references/motion-and-accessibility.mdFour-system motion curves and durations, mandatory accessibility requirements, review checklist
references/framework-mappings.mdToken mapping rules for Tailwind / React / Vue / Compose / SwiftUI
scripts/lint_tokens.pyExecutable validation: hardcoded colors, contrast, core token completeness
assets/mappings/tailwind.cssTailwind v4 @theme token mapping, all four systems can coexist on one page

Related Skills