Back to list
colelawrence

tailwind-v4

by colelawrence

0🍴 0📅 Dec 24, 2025

SKILL.md


name: tailwind-v4 description: Tailwind CSS v4 styling for this project. Use when writing or modifying component styles, CSS classes, or theme configuration. Provides the project's semantic color system and v4-specific patterns.

Tailwind CSS v4 Styling

This project uses Tailwind CSS v4 with CSS-first configuration. All theme customization is in src/styles.css using @theme inline.

Project Color System

Always prefer semantic colors over raw Tailwind colors. These automatically adapt to dark mode.

Core Semantic Tokens

TokenUsageClass Examples
background / foregroundPage background, main textbg-background, text-foreground
card / card-foregroundCard surfacesbg-card, text-card-foreground
popover / popover-foregroundDropdowns, tooltipsbg-popover, text-popover-foreground
primary / primary-foregroundPrimary actions, CTAsbg-primary, text-primary-foreground
secondary / secondary-foregroundSecondary actionsbg-secondary, text-secondary-foreground
muted / muted-foregroundSubdued backgrounds, secondary textbg-muted, text-muted-foreground
accent / accent-foregroundHighlights, hover statesbg-accent, text-accent-foreground
destructive / destructive-foregroundDanger, delete actionsbg-destructive, text-destructive
borderDefault border colorborder-border
inputForm input bordersborder-input
ringFocus ringsring-ring

Within sidebar components: sidebar, sidebar-foreground, sidebar-primary, sidebar-accent, sidebar-border, sidebar-ring

Chart Colors

For data visualization: chart-1 through chart-5

Styling Patterns

Semantic Over Raw Colors

// GOOD - uses semantic colors, works with dark mode
className="bg-card border-border text-muted-foreground hover:bg-accent"

// AVOID - hardcoded colors don't adapt to theme
className="bg-white border-gray-200 text-gray-500 hover:bg-gray-100"

Opacity Modifiers

Use /opacity syntax (NOT deprecated bg-opacity-*):

className="bg-primary/50 border-border/30 text-foreground/80"

Common Component Patterns

Button:

className="bg-primary text-primary-foreground hover:bg-primary/90 focus-visible:ring-2 focus-visible:ring-ring"

Interactive Card:

className="bg-card border border-border hover:border-primary/50 hover:bg-accent/50 transition-colors"

Navigation Item:

className={isActive
  ? "bg-accent text-accent-foreground"
  : "text-muted-foreground hover:text-foreground hover:bg-accent/50"
}

Status Badges:

// Success
className="bg-green-500/10 text-green-600 border-green-500/30"
// Warning
className="bg-yellow-500/10 text-yellow-600 border-yellow-500/30"
// Info
className="bg-blue-500/10 text-blue-600 border-blue-500/30"

Tailwind v4 Specifics

Deprecated Patterns to Avoid

DeprecatedUse Instead
@tailwind base/components/utilities@import "tailwindcss"
bg-opacity-50bg-color/50
text-opacity-50text-color/50
flex-grow / flex-shrinkgrow / shrink
shadow-smshadow-xs
rounded-smrounded-xs
bg-gradient-*bg-linear-*
@layer utilities@utility

v4 Features

Container Queries:

<div className="@container">
  <div className="p-4 @lg:p-8 @xl:grid-cols-2">

3D Transforms:

className="perspective-1000 rotate-x-12 transform-3d"

Enhanced Gradients:

className="bg-linear-45 from-primary to-accent"
className="bg-radial from-primary via-secondary to-accent"

New Variants:

className="@starting-style:opacity-0 opacity-100 transition-opacity"
className="not-hover:opacity-50"
className="nth-odd:bg-muted"

Border Radius

Project-defined computed values:

  • rounded-sm = calc(var(--radius) - 4px)
  • rounded-md = calc(var(--radius) - 2px)
  • rounded-lg = var(--radius) (0.625rem)
  • rounded-xl = calc(var(--radius) + 4px)

Dark Mode

Dark mode uses .dark class on parent. Semantic colors auto-adapt—no dark: variants needed:

// Works in both light and dark mode automatically
className="bg-background text-foreground border-border"

Reference Files

  • Theme configuration: src/styles.css
  • Complete utility reference: UTILITIES.md

Score

Total Score

50/100

Based on repository quality metrics

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

Reviews

💬

Reviews coming soon