agentleFS
agentconfigagentconfig/agentconfig.org/.github/skills/theme-styling/SKILL.md

theme-styling

Skill7 starsChanged 3 months agoISCView on GitHub

Apply consistent theming with Tailwind CSS 4, including dark mode support and design tokens. Use when styling components, fixing dark mode issues, or adjusting visual design.

The file

We split this skill into the rules it gives an agent

9 rules. About 0 are common, 6 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Always use semantic color names, not raw values:

    line 40
  2. Very specific:

    Use the dark: variant for dark mode overrides:

    line 60
  3. Distinctive:

    Use consistent spacing from the Tailwind scale:

    line 77
  4. Distinctive:

    Always start with mobile styles, then add larger breakpoints:

    line 88
  5. Distinctive:

    Use the system font stack (already configured):

    line 101
  6. Distinctive:

    Use consistent state styles:

    line 113
  7. Very specific:

    Use tw-animate-css for animations (already imported):

    line 126
  8. Very specific:

    Always use cn() from @/lib/utils for conditional classes:

    line 141
  9. Distinctive:

    Before considering styling complete:

    line 177

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Theme Styling

Apply consistent styling using Tailwind CSS 4 and the project's theme system.

Tailwind CSS 4

This project uses Tailwind CSS 4, which has significant changes from v3:

  • Uses @theme directive instead of theme() function
  • PostCSS config uses @tailwindcss/postcss
  • CSS variables defined in :root and .dark

Theme System

Colors are defined using CSS custom properties in site/src/index.css:

:root {
  --background: oklch(0.97 0.01 85);
  --foreground: oklch(0.20 0.02 250);
  /* ... more tokens */
}

.dark {
  --background: oklch(0.14 0.02 260);
  --foreground: oklch(0.93 0.01 260);
  /* ... more tokens */
}

See references/color-tokens.md for the complete token list.

Using Theme Colors

Always use semantic color names, not raw values:

// Good - uses theme tokens
<div className="bg-background text-foreground">
<div className="bg-card text-card-foreground">
<div className="border-border">
<button className="bg-primary text-primary-foreground">

// Bad - hardcoded colors
<div className="bg-white text-gray-900">
<div className="bg-[#1a1a2e]">

Dark Mode

Dark mode is implemented via the .dark class on the <html> element.

Adding Dark Mode Styles

Use the dark: variant for dark mode overrides:

// Automatic - uses CSS variables that change with theme
<div className="bg-background text-foreground">

// Manual override - when you need different behavior
<div className="bg-white dark:bg-gray-900">

Testing Dark Mode

  1. Toggle with the theme switcher in the nav
  2. Or use browser DevTools to add/remove .dark class on <html>

Spacing & Layout

Use consistent spacing from the Tailwind scale:

ClassSize
p-20.5rem (8px)
p-41rem (16px)
p-61.5rem (24px)
p-82rem (32px)

Mobile-First Responsive

Always start with mobile styles, then add larger breakpoints:

// Good - mobile first
<div className="p-4 md:p-6 lg:p-8">
<div className="grid-cols-1 md:grid-cols-2 lg:grid-cols-3">

// Bad - desktop first
<div className="p-8 sm:p-6 xs:p-4">

Typography

Use the system font stack (already configured):

<h1 className="text-3xl font-bold">       // 30px bold
<h2 className="text-2xl font-semibold">   // 24px semibold
<h3 className="text-xl font-medium">      // 20px medium
<p className="text-base">                 // 16px regular
<span className="text-sm text-muted-foreground">  // 14px muted

Interactive States

Use consistent state styles:

<button className="
  bg-primary text-primary-foreground
  hover:bg-primary/90
  focus-visible:ring-2 focus-visible:ring-ring
  disabled:opacity-50 disabled:pointer-events-none
">

Animations

Use tw-animate-css for animations (already imported):

<div className="animate-fade-in">
<div className="animate-slide-up">

For custom transitions:

<div className="transition-colors duration-200">
<div className="transition-transform duration-300 hover:scale-105">

The cn() Helper

Always use cn() from @/lib/utils for conditional classes:

import { cn } from '@/lib/utils'

<div className={cn(
  'base-styles',
  isActive && 'active-styles',
  className  // allow overrides via props
)}>

Common Patterns

Card

<div className="bg-card text-card-foreground rounded-lg border border-border p-6">

Section

<section className="py-12 md:py-16 lg:py-20">

Button (Primary)

<button className="
  px-4 py-2 rounded-md
  bg-primary text-primary-foreground
  hover:bg-primary/90
  focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring
">

Checklist

Before considering styling complete:

  • Uses semantic color tokens (bg-background, not bg-white)
  • Works in both light and dark modes
  • Mobile-first responsive design
  • Uses cn() for conditional classes
  • Interactive elements have hover/focus states
  • Spacing follows Tailwind scale (p-4, p-6, etc.)

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.