UB Tailwind
Overview
Use this skill to keep Tailwind usage current and correct across different environments and avoid outdated patterns. This skill targets the latest stable Tailwind CSS: enforce CSS-first setup, apply official framework recipes, and replace legacy defaults in generated guidance.
Implement against the detected project and tooling truth, but bias setup and
migration guidance toward modern CSS-first Tailwind rather than retaining
legacy configuration habits or compatibility layers by default.
Load References On Demand
- Read
../ub-authoring/references/authoring-conventions.md when adjusting routing
guidance or cross-skill authoring conventions.
- Read
references/tailwind-guardrails.md for strict do/don't rules, deprecated syntax traps, and review checklists.
- Read
references/framework-recipes.md for environment-specific setup paths (standalone HTML/CDN, Vue + Vite, Nuxt).
- Read
references/tailwind-legacy-to-modern-migration.md for migration matrix, upgrade replacements, and compatibility caveats.
When Not To Use
- Do not use this skill when the task is plain CSS architecture, selector
strategy, or token-driven styling without Tailwind as the primary surface;
co-load or defer to
ub-css when Tailwind and CSS architecture overlap.
- Do not use this skill when the main issue is framework runtime behavior
rather than Tailwind integration or utility-class authoring.
Core Workflow
- Identify the target environment before writing any Tailwind setup.
- Run required detection checks:
nuxt.config.*, vite.config.*, package.json dependencies, CSS entrypoints, and Nuxt app stylesheet placement (for modern Nuxt, expect app/assets/css/main.css).
- Choose the matching recipe from
references/framework-recipes.md.
- Compare official guidance, repo truth, and observed code reality for
non-trivial or version-sensitive recommendations.
- Surface
OFFICIAL_CONFLICT when authoritative sources, repo truth, or live
code reality materially disagree on a non-trivial recommendation.
- Surface
UNVERIFIED when a non-trivial claim could not be confirmed in
official sources after targeted research.
- Apply modern Tailwind CSS-first rules from
references/tailwind-guardrails.md.
- Apply upgrade-safe replacements from
references/tailwind-legacy-to-modern-migration.md.
- Run the environment-specific validation checklist.
- Reject and replace deprecated or legacy syntax.
Environment Selection
- Use the Standalone HTML/CDN recipe for plain HTML pages without a build tool.
- Use the Vue + Vite recipe for Vue projects with Vite bundling.
- Use the Nuxt recipe for Nuxt apps where integration details differ from plain Vite.
- For Nuxt, default to the official setup path (
@tailwindcss/vite wired in nuxt.config.*), not legacy module defaults.
If the environment is unclear, inspect project markers first (package.json, framework config, build plugins) and do not guess.
Non-Negotiable Guardrails
Tailwind Version and Syntax
- Use modern Tailwind CSS-first patterns and current docs semantics.
- Prefer CSS entrypoint
@import "tailwindcss".
- Prefer CSS directives like
@theme, @utility, @variant, @custom-variant, @source, and @reference as needed.
- Treat
@config and @plugin as legacy paths unless explicitly required for compatibility.
- Prefer compatibility only as a bounded layer with a documented migration back to CSS-first defaults.
Build Strategy
- Do not assume PostCSS is required for modern Tailwind.
- Use Vite plugin integration where applicable (
@tailwindcss/vite) for Vue + Vite workflows.
- For Nuxt, use the official Nuxt framework-guide flow and configure the Vite plugin under Nuxt config instead of creating Vue-only
vite.config.* instructions.
- Keep setup minimal and environment-native.
Vue/Nuxt Style Context
- For Vue/Nuxt component-scoped styles using
@apply or @variant, include @reference to the main stylesheet or app stylesheet context.
- Avoid duplicating imported CSS just to expose theme values in component-local styles.
Design Tokens
- Keep Tailwind tokens centralized in
@theme.
- Reuse existing token primitives and avoid ad-hoc hardcoded drift.
Do Not Generate
- Do not generate
@tailwind base;, @tailwind components;, @tailwind utilities; as the default modern entrypoint.
- Do not assume PostCSS setup is mandatory for modern Tailwind.
- Do not default to
@nuxtjs/tailwindcss as the first-line setup for fresh Nuxt guidance.
Output Requirements
When generating or modifying code, always provide:
- A short environment detection note.
- A source truth note: detected project version, environment markers, and any
material gap versus latest stable guidance.
- The selected setup path (CDN, Vue + Vite, or Nuxt).
- Exact deprecated-to-modern replacements applied (syntax/tooling/utility changes).
- A quick validation checklist confirming modern Tailwind setup.
- Compatibility notes when legacy directives (
@config/@plugin) are retained.
- Conflict note when relevant:
OFFICIAL_CONFLICT or UNVERIFIED with a
concise explanation and the implementation consequence.
Version & Research Policy
- Target the latest stable release of Tailwind CSS.
- Detect the project's actual Tailwind version from
package.json and lockfiles.
- Use web search to verify current best practices, directive availability, and migration guidance against official Tailwind CSS documentation.
- Treat repo truth as the gold implementation standard when deciding what can
actually ship safely in the current project.
- Treat official Tailwind docs as the preferred guidance baseline for
forward-looking design and migration-ready patterns.
- If official guidance and repo truth diverge materially on a non-trivial
recommendation, surface
OFFICIAL_CONFLICT, implement the repo-safe path,
and explain the migration path.
- If official sources disagree with each other on a non-trivial
recommendation, also surface
OFFICIAL_CONFLICT instead of silently
collapsing the disagreement.
- If a non-trivial claim cannot be confirmed in official sources after
targeted research, mark it
UNVERIFIED or avoid presenting it as settled
guidance.
- Keep conflict and uncertainty disclosure scoped to non-trivial,
version-sensitive, or contested guidance rather than trivial edits.
- When the project's installed version is behind latest stable, note the version gap and recommend an upgrade path.
- Inspect the host repository's
AGENTS.md or equivalent instructions when
present for project-specific version policy and tooling; do not assume it
contains this catalog's defaults.
- Do not hardcode version numbers in generated guidance — keep recommendations evergreen.
Freshness Review
- Volatility: high
- Review recommendation: review on touch and during periodic maintenance, targeting a quarterly rhythm when practical.
- Trigger signals: official migration changes, deprecated directives, major Tailwind releases, or repo toolchain changes that affect setup recipes.
- Enforcement: advisory only; stale Tailwind guidance is a review signal, not a blocking gate by itself.
- Stable core: environment detection, official recipe selection, and deprecated-syntax avoidance should remain useful even when exact setup details evolve.
Completion Checklist
- Environment explicitly identified before setup.
- Tailwind entrypoint and directives align with modern guidance.
- No deprecated/legacy syntax remains without explicit compatibility reason.
- Framework-specific differences are handled (CDN vs Vite vs Nuxt).
- Nuxt guidance uses the official framework path and does not drift into Vue-only
vite.config.* steps.
- Token usage is centralized and consistent.
- Generated instructions are concise, deterministic, and current-version oriented.
- Any material official-source conflict or unverified non-trivial guidance is
disclosed explicitly when relevant.
1---2name: ub-tailwind3description: Use this skill for Tailwind setup, migration, integration, and utility-first styling. Apply it when the task mentions Tailwind directives or utilities, @import "tailwindcss", @theme, plugin wiring, legacy-to-modern migration, token bridging with CSS variables, or framework-specific Tailwind build issues.4---5
6# UB Tailwind
7
8## Overview
9
10Use this skill to keep Tailwind usage current and correct across different environments and avoid outdated patterns. This skill targets the latest stable Tailwind CSS: enforce CSS-first setup, apply official framework recipes, and replace legacy defaults in generated guidance.
11
12Implement against the detected project and tooling truth, but bias setup and
13migration guidance toward modern CSS-first Tailwind rather than retaining
14legacy configuration habits or compatibility layers by default.
15
16## Load References On Demand
17
18- Read `../ub-authoring/references/authoring-conventions.md` when adjusting routing
19 guidance or cross-skill authoring conventions.
20- Read `references/tailwind-guardrails.md` for strict do/don't rules, deprecated syntax traps, and review checklists.
21- Read `references/framework-recipes.md` for environment-specific setup paths (standalone HTML/CDN, Vue + Vite, Nuxt).
22- Read `references/tailwind-legacy-to-modern-migration.md` for migration matrix, upgrade replacements, and compatibility caveats.
23
24## When Not To Use
25
26- Do not use this skill when the task is plain CSS architecture, selector
27 strategy, or token-driven styling without Tailwind as the primary surface;
28 co-load or defer to `ub-css` when Tailwind and CSS architecture overlap.
29- Do not use this skill when the main issue is framework runtime behavior
30 rather than Tailwind integration or utility-class authoring.
31
32## Core Workflow
33
341. Identify the target environment before writing any Tailwind setup.
352. Run required detection checks: `nuxt.config.*`, `vite.config.*`, `package.json` dependencies, CSS entrypoints, and Nuxt app stylesheet placement (for modern Nuxt, expect `app/assets/css/main.css`).
363. Choose the matching recipe from `references/framework-recipes.md`.
374. Compare official guidance, repo truth, and observed code reality for
38 non-trivial or version-sensitive recommendations.
395. Surface `OFFICIAL_CONFLICT` when authoritative sources, repo truth, or live
40 code reality materially disagree on a non-trivial recommendation.
416. Surface `UNVERIFIED` when a non-trivial claim could not be confirmed in
42 official sources after targeted research.
437. Apply modern Tailwind CSS-first rules from `references/tailwind-guardrails.md`.
448. Apply upgrade-safe replacements from `references/tailwind-legacy-to-modern-migration.md`.
459. Run the environment-specific validation checklist.
4610. Reject and replace deprecated or legacy syntax.
47
48## Environment Selection
49
50- Use the **Standalone HTML/CDN** recipe for plain HTML pages without a build tool.
51- Use the **Vue + Vite** recipe for Vue projects with Vite bundling.
52- Use the **Nuxt** recipe for Nuxt apps where integration details differ from plain Vite.
53- For Nuxt, default to the official setup path (`@tailwindcss/vite` wired in `nuxt.config.*`), not legacy module defaults.
54
55If the environment is unclear, inspect project markers first (`package.json`, framework config, build plugins) and do not guess.
56
57## Non-Negotiable Guardrails
58
59### Tailwind Version and Syntax
60
61- Use modern Tailwind CSS-first patterns and current docs semantics.
62- Prefer CSS entrypoint `@import "tailwindcss"`.
63- Prefer CSS directives like `@theme`, `@utility`, `@variant`, `@custom-variant`, `@source`, and `@reference` as needed.
64- Treat `@config` and `@plugin` as legacy paths unless explicitly required for compatibility.
65- Prefer compatibility only as a bounded layer with a documented migration back to CSS-first defaults.
66
67### Build Strategy
68
69- Do not assume PostCSS is required for modern Tailwind.
70- Use Vite plugin integration where applicable (`@tailwindcss/vite`) for Vue + Vite workflows.
71- For Nuxt, use the official Nuxt framework-guide flow and configure the Vite plugin under Nuxt config instead of creating Vue-only `vite.config.*` instructions.
72- Keep setup minimal and environment-native.
73
74### Vue/Nuxt Style Context
75
76- For Vue/Nuxt component-scoped styles using `@apply` or `@variant`, include `@reference` to the main stylesheet or app stylesheet context.
77- Avoid duplicating imported CSS just to expose theme values in component-local styles.
78
79### Design Tokens
80
81- Keep Tailwind tokens centralized in `@theme`.
82- Reuse existing token primitives and avoid ad-hoc hardcoded drift.
83
84### Do Not Generate
85
86- Do not generate `@tailwind base;`, `@tailwind components;`, `@tailwind utilities;` as the default modern entrypoint.
87- Do not assume PostCSS setup is mandatory for modern Tailwind.
88- Do not default to `@nuxtjs/tailwindcss` as the first-line setup for fresh Nuxt guidance.
89
90## Output Requirements
91
92When generating or modifying code, always provide:
93
941. A short environment detection note.
952. A source truth note: detected project version, environment markers, and any
96 material gap versus latest stable guidance.
973. The selected setup path (CDN, Vue + Vite, or Nuxt).
984. Exact deprecated-to-modern replacements applied (syntax/tooling/utility changes).
995. A quick validation checklist confirming modern Tailwind setup.
1006. Compatibility notes when legacy directives (`@config`/`@plugin`) are retained.
1017. Conflict note when relevant: `OFFICIAL_CONFLICT` or `UNVERIFIED` with a
102 concise explanation and the implementation consequence.
103
104## Version & Research Policy
105
106- Target the latest stable release of Tailwind CSS.
107- Detect the project's actual Tailwind version from `package.json` and lockfiles.
108- Use web search to verify current best practices, directive availability, and migration guidance against official Tailwind CSS documentation.
109- Treat repo truth as the gold implementation standard when deciding what can
110 actually ship safely in the current project.
111- Treat official Tailwind docs as the preferred guidance baseline for
112 forward-looking design and migration-ready patterns.
113- If official guidance and repo truth diverge materially on a non-trivial
114 recommendation, surface `OFFICIAL_CONFLICT`, implement the repo-safe path,
115 and explain the migration path.
116- If official sources disagree with each other on a non-trivial
117 recommendation, also surface `OFFICIAL_CONFLICT` instead of silently
118 collapsing the disagreement.
119- If a non-trivial claim cannot be confirmed in official sources after
120 targeted research, mark it `UNVERIFIED` or avoid presenting it as settled
121 guidance.
122- Keep conflict and uncertainty disclosure scoped to non-trivial,
123 version-sensitive, or contested guidance rather than trivial edits.
124- When the project's installed version is behind latest stable, note the version gap and recommend an upgrade path.
125- Inspect the host repository's `AGENTS.md` or equivalent instructions when
126 present for project-specific version policy and tooling; do not assume it
127 contains this catalog's defaults.
128- Do not hardcode version numbers in generated guidance — keep recommendations evergreen.
129
130## Freshness Review
131
132- Volatility: high
133- Review recommendation: review on touch and during periodic maintenance, targeting a quarterly rhythm when practical.
134- Trigger signals: official migration changes, deprecated directives, major Tailwind releases, or repo toolchain changes that affect setup recipes.
135- Enforcement: advisory only; stale Tailwind guidance is a review signal, not a blocking gate by itself.
136- Stable core: environment detection, official recipe selection, and deprecated-syntax avoidance should remain useful even when exact setup details evolve.
137
138## Completion Checklist
139
140- Environment explicitly identified before setup.
141- Tailwind entrypoint and directives align with modern guidance.
142- No deprecated/legacy syntax remains without explicit compatibility reason.
143- Framework-specific differences are handled (CDN vs Vite vs Nuxt).
144- Nuxt guidance uses the official framework path and does not drift into Vue-only `vite.config.*` steps.
145- Token usage is centralized and consistent.
146- Generated instructions are concise, deterministic, and current-version oriented.
147- Any material official-source conflict or unverified non-trivial guidance is
148 disclosed explicitly when relevant.