aemerson-commits/shareable-skills/frontend-design
Claude Code and agent skill by aemerson-commits/shareable-skills
- community
Checking that the SKILL.md file is still in the repository.
Design system guide — CSS tokens, Tailwind v4, shadcn/ui components, theming, and UI conventions for consistent dark-themed dashboard interfaces.
Install
npx vskill@latest install aemerson-commits/shareable-skills/frontend-designSKILL.md
The same SKILL.md was published earlier as aemerson-commits/shareable-skills/frontend-design.
Frontend Design Guide
Automatically applies when working on frontend UI/UX tasks. Creates distinctive, production-grade interfaces with consistent styling.
Design System Stack
| Layer | Technology | Purpose | |
|---|---|---|---|
| Tokens | shared/theme.css (CSS custom properties) | Color, spacing, typography, radius, shadows, z-index | |
| Themes | shared/ThemeToggle.jsx (multiple presets) | Theme switching via data-theme attribute on <html> | |
| Animations | shared/animations.css | Shared keyframes + reduced-motion support | |
| Utilities | Tailwind CSS v4 (@tailwindcss/vite) | Utility-first classes, no preflight (coexists with vanilla CSS) | |
| Components | shadcn/ui | Accessible primitives: Button, Dialog, Input, Badge, Table, etc. | |
| Existing CSS | Per-project App.css | Unlayered vanilla CSS (wins specificity over Tailwind @layer) |
Design Tokens (shared/theme.css)
All colors, spacing, and visual properties use CSS custom properties. Never hardcode hex values — use tokens.
Color Tokens
| Token | Dark Value | Usage | |
|---|---|---|---|
--bg-app | #111827 | Page/app background | |
--bg-surface | #1F2937 | Card/panel backgrounds | |
--bg-elevated | #374151 | Hover states, secondary bg | |
--bg-inset | #0F172A | Inset/recessed areas | |
--text-primary | #F9FAFB | Main content text | |
--text-secondary | #9CA3AF | Labels, descriptions | |
--text-muted | #6B7280 | Hints, timestamps | |
--accent | #3B82F6 | Primary actions, links | |
--accent-hover | #2563EB | Hover on accent | |
--accent-muted | #60A5FA | Light accent variant | |
--status-error | #EF4444 | Errors, late items | |
--status-warning | #F59E0B | Warnings, approaching due | |
--status-success | #10B981 | Success, on-time | |
--status-info | #3B82F6 | Informational | |
--border-default | #374151 | Standard borders | |
--border-subtle | #1F2937 | Subtle dividers |
Spacing Scale
--space-xs (0.25rem) through --space-3xl (3rem). Use in CSS: padding: var(--space-md).
Typography Scale
--text-xs (0.75rem) through --text-3xl (1.875rem). Use: font-size: var(--text-sm).
Radius, Shadows, Z-Index
- Radius:
--radius-smthrough--radius-full - Shadows:
--shadow-smthrough--shadow-xl - Z-index:
--z-base(1) through--z-toast(9999)
Tailwind v4 Integration
Tailwind v4 is installed via @tailwindcss/vite plugin. No preflight — existing CSS is preserved.
@theme inline Mapping
The @theme inline block in index.css maps your tokens to Tailwind utilities:
shadcn/ui standard names (used by shadcn components internally):
bg-primary→var(--accent)(your accent color)text-primary-foreground→#ffffff(text on primary buttons)bg-background→var(--bg-app)text-foreground→var(--text-primary)bg-card→var(--bg-surface)bg-secondary/bg-muted/bg-accent→var(--bg-elevated)(shadcn "accent" = hover bg)text-muted-foreground→var(--text-muted)bg-destructive→var(--status-error)border(default) →var(--border-default)ring-ring→var(--accent)
Custom names (use in your own Tailwind code):
bg-app,bg-surface,bg-elevated,bg-inset— layout backgroundsbg-accent-primary,bg-accent-hover— accent color (distinct from shadcnbg-accent)bg-error,bg-warning,bg-success,bg-info— status colorstext-text-primary,text-text-secondary,text-text-muted— text colorsborder-border-subtle— subtle borders
Specificity Rules
- Unlayered CSS (existing
App.css) always wins over Tailwind's@layer utilities - When migrating a component to Tailwind, remove its CSS rules to avoid conflicts
rgba()values stay as-is until converted tooklch()or Tailwind opacity modifiers (bg-primary/15)
shadcn/ui Components
Setup
- Config:
components.json(style: new-york, jsx, zinc base) - Utility:
src/lib/utils.js—cn()function (clsx + tailwind-merge) - Path alias:
@/*→./src/*(in vite.config.js + jsconfig.json) - Components:
src/components/ui/*.jsx
Available Components
| Component | Import | Usage | |
|---|---|---|---|
Button | @/components/ui/button | Actions, CTA. Variants: default, destructive, outline, secondary, ghost, link | |
Dialog | @/components/ui/dialog | Modal dialogs. Use DialogContent, DialogHeader, DialogTitle, etc. | |
Input | @/components/ui/input | Form text inputs | |
Badge | @/components/ui/badge | Status badges. Variants: default, secondary, destructive, outline | |
Table | @/components/ui/table | Data tables (Table, TableHeader, TableBody, TableRow, TableCell) | |
DropdownMenu | @/components/ui/dropdown-menu | Context menus, action menus | |
Tooltip | @/components/ui/tooltip | Hover tooltips (needs TooltipProvider) | |
Sonner (Toast) | @/components/ui/sonner | Toast notifications via sonner | |
Card | @/components/ui/card | Content cards (Card, CardHeader, CardTitle, CardContent) | |
Tabs | @/components/ui/tabs | Tab navigation (Tabs, TabsList, TabsTrigger, TabsContent) |
Usage Pattern
Adding New shadcn Components
Components generate as .jsx into src/components/ui/. No TypeScript cleanup needed.
Theme System
Theme Presets
Themes work by swapping CSS custom property values via [data-theme="X"] selectors in shared/theme.css. A ThemeToggle component persists the choice to localStorage.
Example presets to support:
| Group | Themes | |
|---|---|---|
| Auto | System (follows OS) | |
| Standard | Dark (default), Light, Dim, High Contrast | |
| Popular | Midnight, Nord, Dracula, Catppuccin | |
| Classic | Solarized Dark, Solarized Light |
Adding a New Theme
- Add theme object to
THEMESarray inThemeToggle.jsx - Add
[data-theme="your-theme"]selector block intheme.csswith all token overrides - Light themes: set
color-scheme: lightand ensure stronger contrast (--text-primary: #0F172A)
Component Patterns
KPI Cards
Use a consistent KPICard component for metric cards across all projects:
- Grid: 4 columns desktop, 2 mobile (
@media max-width: 768px) - Structure: label, value (large), unit/trend, optional delta
Charts (Recharts)
Use shared tooltip styles if your project exports them:
Legend standard (enforced — e.g. via `scripts/lint-chart-legends.mjs`). A multi-series chart (2+ bars/lines/areas, or a .map() that emits a series per datum) MUST give the reader a labeled key for its colors, two ways:
- Visible legend — add
<Legend wrapperStyle={{ fontSize: 11 }} />(11px keeps it
readable on compact cards). Every series needs a name= prop so the legend (and tooltip) labels it.
- Color-aware tooltip — the popup must show each series' color, not a uniform gray.
A shared CHART_TOOLTIP that sets itemStyle:{color:'var(--text-secondary)'} flattens every row to one color. On a multi-series chart, pass a custom content= that colors each row by entry.color instead:
- Single-series charts are exempt — the card title names the one series; a legend is noise.
- Custom / non-`<Legend>` key (e.g. a color-dot caption or a deliberately key-less chart):
annotate it so lint skips it — {/* chart-legend-ok: <reason> */} on or just above the chart element.
- If using a ratcheted lint gate: existing charts are grandfathered; it fails only on a NEW
multi-series chart that lacks a legend or color-aware tooltip.
A lint that checks legend presence is satisfied by a bare <Legend />, so the check doesn't prove the legend is useful.
Reference legends (a key to a table, not a chart). When a legend explains what the badges, marks or colours in a table mean, build it from one shared panel component rather than per-view markup:
- Make the swatch the real component the table renders (or its real CSS class), so the key restyles itself when the table does. Deliberately offer no
items=[{color,label}]data prop: a hand-written hex is a copy that silently drifts from the CSS it describes. - Group with an eyebrow label and a hairline, not nested bordered cards, which read as separate panels inside a collapsible.
- Drive layout with one
auto-fitcolumn width, not a per-view column count, and persist open/closed state in storage with a safe fallback when storage throws.
Additional chart patterns:
- Dark tooltips require THREE props:
contentStyle,labelStyle,itemStyle - Bundle split: Keep Recharts in
manualChunks(vite.config.js) - ResponsiveContainer:
height={isMobile ? 200 : 250}standard
Tables
table-layout: fixed+<colgroup>for resizable columns- Column widths persist to localStorage
- Sticky headers:
position: sticky; top: 0; z-index: var(--z-sticky) - Alternate row coloring:
tr:nth-child(even)with subtle surface variation
Modals
Use a shared modal component with:
- Focus trap (
useModalA11yor native<dialog>+showModal()) - Overlay-click-to-close:
if (e.target === e.currentTarget) onClose()on the overlay — do NOT usestopPropagationon inner content (breaks children that render outside the DOM tree viaReactDOM.create*APIs) - Backdrop:
rgba(0, 0, 0, 0.5)with optional blur - Escape key close
- Scroll lock on body while open
Collapsible groups — Expand all / Collapse all
Any view that renders a list of collapsible sections/accordions/groups MUST offer bulk Expand all / Collapse all controls — don't re-implement per-group useState(open) with no bulk control, and don't let each new grouped view invent its own toggle shape.
- Extract a shared hook (
useExpandCollapseAll(defaultOpen)) that returns{ isOpen(id), toggle(id), expandAll(), collapseAll() }and tolerates a changing id set — newly-loaded groups should inherit the current default so it works before data loads and after the list grows. - Extract a paired control component for the toolbar/filter bar (
<ExpandCollapseControls onExpandAll={...} onCollapseAll={...} />). - Lift the per-group open state to the parent so the bulk controls actually drive every group, rather than each group owning its own isolated state.
Apply this to every new grouped/accordion view, not just the first one that needed it — it's cheap to reuse and expensive to reinvent per view.
CSS Architecture
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/frontend-design/SKILL.md
Popularity
- Repository stars
- 1
- 7-day trend score
- 3
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/aemerson-commits/shareable-skills/frontend-design)