跳到正文
cccskills
免费在 GitHub 公开

tailwind

Use when writing or reviewing any CSS class, changing colors, modifying globals.css, or when hardcoded colors or inline styles are detected.

中文简介正在准备中。当前显示原文说明。

holger1411/astrodeck星标 80(GitHub 80 + cccskills 0)

实测评分 未实测

查看安装方法

包含的文件(2)

  • SKILL.md3.0 KB
  • LEARNINGS.md734 B

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

Tailwind CSS Skill

Canonical Sources

This skill references the following globals — read them BEFORE starting work:

  • system/globals/colors.md — OKLCH palette, token table, color semantics
  • system/globals/effects.md — Border radius, shadows, card pattern

Domain

Tailwind v4 Expertise, @theme Directive, OKLCH, Utilities, Dark Mode

KPIs

MetricTargetMeasurement
Hardcoded Colors0npm run check:kpis
Inline Styles0npm run check:kpis
tailwind.config.mjsmust not existnpm run check:kpis

npm run check:kpis (.claude/scripts/check-kpis.mjs) is the single source of truth for these checks — do not re-implement them with ad-hoc greps. The convention guard hook additionally warns when a change introduces hardcoded colors or inline styles.

Rules

Tailwind v4 Setup

AstroDeck uses Tailwind CSS v4 via @tailwindcss/vite (NOT @astrojs/tailwind).

  • No tailwind.config.mjs — config lives in CSS
  • @theme directive for token registration
  • .dark class for dark mode overrides

@theme vs .dark

/* Token registration (Tailwind recognizes these as utilities) */
@theme {
  --color-primary: oklch(11.2% 0.0079 286.75);
  --color-primary-foreground: oklch(100% 0 0);
}

/* Dark mode overrides (only change values, no new tokens) */
.dark {
  --color-primary: oklch(100% 0 0);
  --color-primary-foreground: oklch(11.41% 0.0079 286.75);
}

Dark Mode Pattern

Do NOT control colors with dark: prefix. Use CSS variables that automatically override in .dark:

<!-- Wrong -->
<div class="bg-white dark:bg-gray-900 text-black dark:text-white">

<!-- Correct -->
<div class="bg-background text-foreground">

Utility Patterns

/* Responsive (mobile-first) */
text-base md:text-lg lg:text-xl

/* Hover/Focus states */
hover:bg-primary/90 focus:ring-2 focus:ring-ring

/* Transitions */
transition-colors duration-200

/* Dark mode (automatic via CSS variables) */
bg-background text-foreground  /* works in both modes */

Non-Negotiable

These rules always apply — even under time pressure, even for "just a quick fix":

  • No hardcoded colors. bg-blue-500 is never "just temporary" — it gets forgotten and breaks on the next theme change.
  • No inline styles. Not even "just for this special case." Tailwind utilities cover everything.
  • OKLCH only. "HSL is more readable" is not an argument — the entire design system is based on OKLCH. Mixing destroys color consistency.
  • No tailwind.config.mjs. Not even "because a package expects it." Config lives in CSS via @theme.
  • No @astrojs/tailwind. AstroDeck uses @tailwindcss/vite. The old integration is incompatible with Tailwind v4.

Before Applying

Read LEARNINGS.md in this directory to avoid known anti-patterns.

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

Use when creating or modifying any UI element visible to the user, reviewing HTML markup, adding interactive elements, or when Lighthouse Accessibility drops below 90.

中文简介正在准备中。当前显示原文说明。

holger1411/astrodeck802026年9月5日 更新

astro

免费

Use when creating or modifying .astro/.tsx files, configuring astro.config.mjs, working with Content Collections, or when TypeScript or build errors occur.

中文简介正在准备中。当前显示原文说明。

holger1411/astrodeck802026年9月5日 更新

Use when creating or editing pages, blog posts, or content files, adding meta tags, or when Lighthouse SEO drops below 90.

中文简介正在准备中。当前显示原文说明。

holger1411/astrodeck802026年9月5日 更新

qa

免费

Use when completing any task (final validation step), running audits, preparing for deployment, or when ESLint/TypeScript/build errors occur.

中文简介正在准备中。当前显示原文说明。

holger1411/astrodeck802026年9月5日 更新

readme

免费

Use when starting work on an AstroDeck project, needing to understand the project structure, or looking up available components, sections, and layouts.

中文简介正在准备中。当前显示原文说明。

holger1411/astrodeck802026年9月5日 更新

ui-design

免费

Use when creating or modifying any visible UI element, adjusting spacing or typography, reviewing visual consistency, or when Lighthouse Performance drops below 90.

中文简介正在准备中。当前显示原文说明。

holger1411/astrodeck802026年9月5日 更新

查看 holger1411 的全部技能

报告此技能的问题