CSS, SCSS, And Tailwind Styling
Use this skill for project-neutral stylesheet work. Inspect the repository before
assuming plain CSS, SCSS/Sass, CSS modules, CSS-in-JS, Tailwind CSS, another
utility framework, or a framework convention. Keep the guidance operational:
preserve local conventions, choose the simplest styling system that satisfies the
requirement, and verify the generated, compiled, and browser-visible result.
Use When
- Editing
.css, .scss, .sass, *.module.css, *.module.scss, design-token
files, global stylesheets, component styles, theme files, or stylesheet build
config.
- Changing cascade behavior, layout, responsive behavior, accessibility-related
visual states, browser compatibility, or style performance.
- Deciding among plain CSS, SCSS, Tailwind, or an intentional hybrid; converting
or adopting one safely; or avoiding an unnecessary tool or migration.
- Integrating styles with static HTML, JS/TS apps, PHP/Smarty templates, Python web
templates, Rust Leptos/Axum apps, CSS-in-JS, CSS modules, utility CSS, or
framework-specific styling conventions.
Do not use this skill for UI behavior with no stylesheet or browser-visible
styling change. Use javascript-typescript-engineering,
python-engineering, or
rust-async-web for language/framework mechanics;
add this skill only when styling choices or style build behavior matter. Use
ux-accessibility-review as primary for a
rendered-interface accessibility or UX audit; use this skill to implement or
review the underlying stylesheet behavior.
For photo/video catalog viewers, compose with
digital-asset-management for media
display, organization, and viewer behavior; this skill remains responsible for
the stylesheet implementation.
For a Tauri WebView frontend, its CSS/SCSS and browser-visible styles are in
scope. Iced, egui/eframe, and Slint native widget layout, styling, and theming
are not CSS work; use rust-desktop-gui for
those frameworks.
Workflow
- Detect the existing styling system before editing. Look at file patterns,
imports, build scripts, framework config, README, design docs, Storybook or
component examples, screenshots, and browser/E2E tests.
- Identify the ownership boundary: global reset/theme, design tokens, component
module, utility classes, template-level styles, generated CSS, or framework
asset pipeline.
- Preserve the established styling system unless the task explicitly calls for
adoption or migration. In a repository without one, choose plain CSS unless
Tailwind or SCSS provides clear, evidence-backed value; do not introduce a
framework or preprocessor for one isolated change.
- Make the smallest style change that preserves existing naming, cascade,
token, breakpoint, and build conventions.
- Verify both the source and output: formatter/linter, SCSS compilation when
applicable, app build, targeted UI/browser tests, and a manual or screenshot
check when layout/visual behavior is the product.
Detect The Styling System
Use multiple clues; one dependency or file name is not enough.
| Surface |
Clues |
| Plain CSS |
.css, styles.css, app.css, globals.css, assets/css/, <link rel="stylesheet">, JS/TS imports of .css, no Sass dependency or loader. |
| SCSS/Sass |
.scss, .sass, _partial.scss, @use, @forward, $variables, @mixin, @include, sass or sass-embedded dependencies, sass-loader, vite/webpack/esbuild Sass config, sass CLI scripts. |
| CSS modules |
*.module.css, *.module.scss, imports such as import styles from "./Button.module.css", generated scoped class names. |
| CSS-in-JS |
styled-components, @emotion/*, vanilla-extract, stitches, linaria, stylex, css\...`, styled.div`, extracted CSS build plugins. |
| Tailwind CSS |
tailwindcss, @tailwindcss/vite, @tailwindcss/postcss, or @tailwindcss/cli dependencies; @import "tailwindcss", @theme, or @source; legacy tailwind.config.* or @tailwind directives; PostCSS/Vite/framework integration; utility class strings in templates/components. |
| Other utility CSS |
UnoCSS/Windi dependencies or config, utility presets, generated utility entrypoints, and dense utility class strings in templates/components. |
| Framework conventions |
Next/Vite/Astro/Svelte/Vue/Angular style entrypoints, Django/Flask static folders and templates, Rails-style asset folders, Leptos/Trunk/cargo-leptos static assets, Axum static-file routes. |
| PHP/Smarty templates |
.php, .tpl, template folders, PHP/Smarty asset registration, stable template class hooks, and host/framework static asset paths. |
When conventions conflict, follow the closest local owner. For example, a React
app may use global CSS for tokens, CSS modules for components, and utility
classes for layout; do not collapse those into one system unless the task is an
explicit migration.
For Tailwind, determine the installed major version from the manifest and
lockfile, then corroborate it with the stylesheet entrypoint, framework plugin,
and configuration. Do not infer a version from one directive or copy syntax from
a different major. Consult the installed version's official setup,
configuration, source-detection, migration, and compatibility guidance.
Tailwind And Migration Details
For Tailwind selection, source scanning, major-version compatibility, adoption,
upgrades, or stylesheet migrations, load
references/tailwind-and-migrations.md.
Do not load that detail for an ordinary bounded CSS or SCSS edit.
CSS Versus SCSS Decision Rules
CSS is the browser's stylesheet language. Use it directly when the project can
express the style with the platform: custom properties, cascade layers, media
queries, container queries, logical properties, Grid/Flexbox, modern selectors,
and native nesting where the target browsers or build pipeline support it.
SCSS is the CSS-like syntax for Sass, a preprocessor that compiles to CSS. Sass
also has the indented .sass syntax; do not introduce .sass unless the
repository already uses it. Prefer .scss for new Sass work because it is close
to CSS and easier to migrate incrementally.
Prefer plain CSS when:
- The project already uses CSS and modern CSS features solve the problem.
- The only desired SCSS feature is shallow nesting, variables, or simple file
organization that CSS custom properties, native nesting,
@layer, and imports
or bundler entrypoints already cover.
- Runtime theming, user preferences, dark mode, container-size changes, or
JavaScript-adjusted tokens need CSS custom properties in the browser.
- The project has no Sass build path and adding one would expand dependencies,
CI time, editor setup, or deployment risk.
Prefer SCSS when:
- The repository already uses Sass and the change fits its module/token/mixin
structure.
- Compile-time composition materially reduces duplication: shared maps, generated
variants, math, functions, mixins, partials, or a package-style stylesheet API.
- A design system has many related tokens that need compile-time validation or
exports through
@use/@forward.
- A legacy SCSS codebase needs cleanup, migration from
@import, or safer
modularization without changing the browser-facing CSS contract.
If the decision is not obvious, state the tradeoff and choose the option that
adds less toolchain and migration burden.
Modern CSS Guidance
- Use custom properties (
--token) for runtime theme values, component-local
tokens, dark/light modes, user preferences, and values JavaScript or media
queries may change. Keep fallback values deliberate.
- Use cascade layers (
@layer reset, base, components, utilities;) to make
precedence explicit for resets, tokens, components, and overrides. Do not use
specificity wars as a layer substitute.
- Use container queries for components that respond to their container, not the
viewport. Keep media queries for viewport, device, and user-preference concerns
such as
prefers-reduced-motion, prefers-color-scheme, or coarse pointers.
- Use logical properties (
margin-inline, padding-block, inset-inline,
border-start-start-radius) when layout should survive writing-mode or
direction changes.
- Use Flexbox for one-dimensional alignment and Grid for two-dimensional layout.
Avoid float/table layout except for true legacy constraints.
- Use native CSS nesting only when local browser support or the build pipeline
supports it; keep nesting shallow and avoid hiding selector specificity.
- Represent design tokens close to their consumption: global primitives on
:root, semantic tokens in theme scopes, and component tokens on component
roots. Avoid magic numbers unless the value is truly one-off.
- Prefer semantic class names and component boundaries over selectors coupled to
deep DOM structure.
Modern SCSS Guidance
- Use the Sass module system. Prefer
@use for consuming variables, mixins, and
functions, and @forward for exposing a curated module API. Avoid adding new
@import; current Sass treats it as deprecated and it will be removed in a
future major Dart Sass release.
- Keep module members namespaced (
theme.$space-2, @include buttons.reset) so
origins stay clear. Use as * only for a small, intentional compatibility
layer.
- Use
$variables for compile-time constants and CSS custom properties for
runtime theming. Do not replace runtime var(--token) values with Sass
variables unless the value never changes in the browser.
- Use mixins for repeated declaration groups that need parameters or feature
gates. Avoid mixins that hide large, unrelated blocks of CSS.
- Use functions for pure value calculations. Keep side effects and emitted CSS in
mixins, not functions.
- Use maps for related token sets and generated variants; validate expected keys
where the project has patterns for doing so.
- Use partials (
_tokens.scss) for files loaded by modules. Keep entrypoints
explicit (app.scss, index.scss) and avoid accidental emitted CSS from helper
files unless the module is meant to emit it.
- Use interpolation (
#{$name}) sparingly for generated selectors, custom
property names, or asset paths. Avoid interpolation that makes selector search
and refactoring unreliable.
- Treat Sass as a build dependency. Update scripts, bundler config, Docker/CI, and
generated output policy when introducing it.
Integration Patterns
- HTML pages: link compiled CSS through
<link rel="stylesheet"> in the
intended order. Keep critical inline styles minimal and avoid duplicating large
rules across pages.
- JavaScript/TypeScript apps: use existing bundler conventions for CSS
imports, CSS modules, extracted CSS, PostCSS, or CSS-in-JS. Load
javascript-typescript-engineering
when package scripts, lockfiles, Vite/Webpack/Next/etc. config, or TypeScript
component code changes.
- Python web apps: keep templates responsible for markup and class hooks;
serve styles through the framework's static asset path such as Django static
files or Flask
url_for("static", ...). Load
python-engineering when routes, templates,
packaging, or framework config changes.
- PHP/Smarty templates: templates own semantic markup and stable class hooks;
styles flow through the host or framework asset path.
- Rust Leptos/Axum apps: keep Leptos components deterministic for SSR and
hydration, use class/style bindings only where they produce stable markup, and
serve compiled assets through the app's Trunk/cargo-leptos/Axum static route.
Load
rust-async-web when server functions,
hydration, routing, WASM targets, or Axum static-file behavior changes.
- Tailwind and other utility CSS: apply the decision and source-detection
rules above, then follow the local framework, version, entrypoint, token, and
component conventions. Do not replace established utilities with handcrafted
CSS, or vice versa, without an explicit migration goal.
- CSS-in-JS: follow the existing extraction/runtime model. Keep dynamic values
bounded, avoid per-render stylesheet churn, and verify SSR/hydration behavior
when styles are generated server-side.
Accessibility, Responsive Design, And Performance
- Preserve visible focus states, hover/focus/active/disabled distinctions,
contrast, text resizing, zoom, reduced-motion preferences, and hit-target sizes.
- Responsive behavior should come from fluid layout, intrinsic sizing, container
queries, and minimal breakpoints before adding many viewport-specific overrides.
- Use
rem, em, percentages, viewport/container units, and logical properties
where they preserve user settings and layout direction.
- Keep animations cheap and optional: prefer transform/opacity, avoid layout
thrash, and respect
prefers-reduced-motion.
- Avoid loading unused CSS. Check code splitting, extraction, purging/content
scanning, and critical CSS only within the project's existing build model.
- Check browser compatibility against the project's stated support matrix,
Browserslist, framework baseline, or test browsers. Consult current official
documentation for version-sensitive Tailwind, framework, Sass, or build-tool
behavior.
Anti-Patterns
- Introducing Tailwind for one component or isolated fix in a repository with
an established styling system.
- Running Tailwind and CSS/SCSS as overlapping systems without explicit ownership
or a bounded migration plan.
- Mixing configuration, directives, plugins, or migration advice from different
Tailwind major versions; or combining current Tailwind v4 with Sass, Less, or
Stylus without contrary evidence from the installed version's official docs.
- Constructing utility class fragments dynamically, then using a broad safelist
as a substitute for finite mappings to complete class strings.
- Accumulating arbitrary values, global
!important, or one-off plugins instead
of extending shared tokens and resolving the actual cascade boundary.
- Rebuilding every utility string with
@apply, or using utilities in isolated
CSS modules/component style blocks without the installed version's required
reference/build context.
- Ignoring Preflight or other base-style effects on existing elements and
third-party widgets.
- Converting to SCSS by default when CSS custom properties,
@layer, native
nesting, or container queries are enough.
- Adding
@import to new Sass code instead of @use/@forward.
- Using Sass variables for values that must change at runtime in the browser.
- Deep nesting that hides specificity and makes overrides brittle.
- Global selectors, resets, or utility overrides that leak outside their intended
layer or component boundary.
- Copying class strings, breakpoints, colors, or z-index values instead of using
existing tokens and conventions.
- Hiding behavior-critical state only in color or motion without accessible text,
focus, or reduced-motion alternatives.
- Treating formatter/linter success as proof that layout, cascade, accessibility,
or browser compatibility is correct.
Security And Evidence
Load security-review when styling work touches
CSP, external fonts/assets, user-generated HTML/CSS, template rendering, Markdown
or rich-text styling, inline styles with untrusted values, URL-valued CSS,
uploaded assets, or SSR injection paths. Use
security-review-evidence when reports
include screenshots, DOM excerpts, network traces, tokens, private URLs, or other
sensitive evidence.
Successful Use
The final handoff states the styling system and installed Tailwind major detected,
the Tailwind-vs-CSS-vs-SCSS decision, files changed, build/tooling and source-scan
impact, validation commands run, visual or browser checks performed, and
remaining cascade/reset, browser, accessibility, and performance risk. Omit
Tailwind-specific details when Tailwind is not part of the task.
1---2name: css-scss-styling3description: CSS, SCSS/Sass, and Tailwind CSS styling guidance. Use when adding, changing, reviewing, refactoring, adopting, or migrating .css, .scss, .sass, CSS modules, design tokens, cascade layers, container/media queries, responsive layout, stylesheet build pipelines, Tailwind or other utility-class conventions, CSS-in-JS, or styling integration in HTML, JavaScript/TypeScript, PHP/Smarty templates, Python templates, or Rust Leptos/Axum apps. Use ux-accessibility-review for interface accessibility or UX audits. Use language/framework skills for non-styling implementation mechanics and do not use for behavior changes with no styling surface.4metadata:5 source: https://skillmd.com/skills/nledford/css-scss-styling6---78# CSS, SCSS, And Tailwind Styling910Use this skill for project-neutral stylesheet work. Inspect the repository before11assuming plain CSS, SCSS/Sass, CSS modules, CSS-in-JS, Tailwind CSS, another12utility framework, or a framework convention. Keep the guidance operational:13preserve local conventions, choose the simplest styling system that satisfies the14requirement, and verify the generated, compiled, and browser-visible result.1516## Use When1718- Editing `.css`, `.scss`, `.sass`, `*.module.css`, `*.module.scss`, design-token19 files, global stylesheets, component styles, theme files, or stylesheet build20 config.21- Changing cascade behavior, layout, responsive behavior, accessibility-related22 visual states, browser compatibility, or style performance.23- Deciding among plain CSS, SCSS, Tailwind, or an intentional hybrid; converting24 or adopting one safely; or avoiding an unnecessary tool or migration.25- Integrating styles with static HTML, JS/TS apps, PHP/Smarty templates, Python web26 templates, Rust Leptos/Axum apps, CSS-in-JS, CSS modules, utility CSS, or27 framework-specific styling conventions.2829Do not use this skill for UI behavior with no stylesheet or browser-visible30styling change. Use [`javascript-typescript-engineering`](../javascript-typescript-engineering/SKILL.md),31[`python-engineering`](../python-engineering/SKILL.md), or32[`rust-async-web`](../rust-async-web/SKILL.md) for language/framework mechanics;33add this skill only when styling choices or style build behavior matter. Use34[`ux-accessibility-review`](../ux-accessibility-review/SKILL.md) as primary for a35rendered-interface accessibility or UX audit; use this skill to implement or36review the underlying stylesheet behavior.3738For photo/video catalog viewers, compose with39[`digital-asset-management`](../digital-asset-management/SKILL.md) for media40display, organization, and viewer behavior; this skill remains responsible for41the stylesheet implementation.4243For a Tauri WebView frontend, its CSS/SCSS and browser-visible styles are in44scope. Iced, egui/eframe, and Slint native widget layout, styling, and theming45are not CSS work; use [`rust-desktop-gui`](../rust-desktop-gui/SKILL.md) for46those frameworks.4748## Workflow49501. Detect the existing styling system before editing. Look at file patterns,51 imports, build scripts, framework config, README, design docs, Storybook or52 component examples, screenshots, and browser/E2E tests.532. Identify the ownership boundary: global reset/theme, design tokens, component54 module, utility classes, template-level styles, generated CSS, or framework55 asset pipeline.563. Preserve the established styling system unless the task explicitly calls for57 adoption or migration. In a repository without one, choose plain CSS unless58 Tailwind or SCSS provides clear, evidence-backed value; do not introduce a59 framework or preprocessor for one isolated change.604. Make the smallest style change that preserves existing naming, cascade,61 token, breakpoint, and build conventions.625. Verify both the source and output: formatter/linter, SCSS compilation when63 applicable, app build, targeted UI/browser tests, and a manual or screenshot64 check when layout/visual behavior is the product.6566## Detect The Styling System6768Use multiple clues; one dependency or file name is not enough.6970| Surface | Clues |71| --- | --- |72| Plain CSS | `.css`, `styles.css`, `app.css`, `globals.css`, `assets/css/`, `<link rel="stylesheet">`, JS/TS imports of `.css`, no Sass dependency or loader. |73| SCSS/Sass | `.scss`, `.sass`, `_partial.scss`, `@use`, `@forward`, `$variables`, `@mixin`, `@include`, `sass` or `sass-embedded` dependencies, `sass-loader`, `vite`/`webpack`/`esbuild` Sass config, `sass` CLI scripts. |74| CSS modules | `*.module.css`, `*.module.scss`, imports such as `import styles from "./Button.module.css"`, generated scoped class names. |75| CSS-in-JS | `styled-components`, `@emotion/*`, `vanilla-extract`, `stitches`, `linaria`, `stylex`, `css\`...\``, `styled.div`, extracted CSS build plugins. |76| Tailwind CSS | `tailwindcss`, `@tailwindcss/vite`, `@tailwindcss/postcss`, or `@tailwindcss/cli` dependencies; `@import "tailwindcss"`, `@theme`, or `@source`; legacy `tailwind.config.*` or `@tailwind` directives; PostCSS/Vite/framework integration; utility class strings in templates/components. |77| Other utility CSS | UnoCSS/Windi dependencies or config, utility presets, generated utility entrypoints, and dense utility class strings in templates/components. |78| Framework conventions | Next/Vite/Astro/Svelte/Vue/Angular style entrypoints, Django/Flask static folders and templates, Rails-style asset folders, Leptos/Trunk/cargo-leptos static assets, Axum static-file routes. |79| PHP/Smarty templates | `.php`, `.tpl`, template folders, PHP/Smarty asset registration, stable template class hooks, and host/framework static asset paths. |8081When conventions conflict, follow the closest local owner. For example, a React82app may use global CSS for tokens, CSS modules for components, and utility83classes for layout; do not collapse those into one system unless the task is an84explicit migration.8586For Tailwind, determine the installed major version from the manifest and87lockfile, then corroborate it with the stylesheet entrypoint, framework plugin,88and configuration. Do not infer a version from one directive or copy syntax from89a different major. Consult the installed version's official setup,90configuration, source-detection, migration, and compatibility guidance.9192## Tailwind And Migration Details9394For Tailwind selection, source scanning, major-version compatibility, adoption,95upgrades, or stylesheet migrations, load96[`references/tailwind-and-migrations.md`](references/tailwind-and-migrations.md).97Do not load that detail for an ordinary bounded CSS or SCSS edit.9899## CSS Versus SCSS Decision Rules100101CSS is the browser's stylesheet language. Use it directly when the project can102express the style with the platform: custom properties, cascade layers, media103queries, container queries, logical properties, Grid/Flexbox, modern selectors,104and native nesting where the target browsers or build pipeline support it.105106SCSS is the CSS-like syntax for Sass, a preprocessor that compiles to CSS. Sass107also has the indented `.sass` syntax; do not introduce `.sass` unless the108repository already uses it. Prefer `.scss` for new Sass work because it is close109to CSS and easier to migrate incrementally.110111Prefer **plain CSS** when:112113- The project already uses CSS and modern CSS features solve the problem.114- The only desired SCSS feature is shallow nesting, variables, or simple file115 organization that CSS custom properties, native nesting, `@layer`, and imports116 or bundler entrypoints already cover.117- Runtime theming, user preferences, dark mode, container-size changes, or118 JavaScript-adjusted tokens need CSS custom properties in the browser.119- The project has no Sass build path and adding one would expand dependencies,120 CI time, editor setup, or deployment risk.121122Prefer **SCSS** when:123124- The repository already uses Sass and the change fits its module/token/mixin125 structure.126- Compile-time composition materially reduces duplication: shared maps, generated127 variants, math, functions, mixins, partials, or a package-style stylesheet API.128- A design system has many related tokens that need compile-time validation or129 exports through `@use`/`@forward`.130- A legacy SCSS codebase needs cleanup, migration from `@import`, or safer131 modularization without changing the browser-facing CSS contract.132133If the decision is not obvious, state the tradeoff and choose the option that134adds less toolchain and migration burden.135136## Modern CSS Guidance137138- Use custom properties (`--token`) for runtime theme values, component-local139 tokens, dark/light modes, user preferences, and values JavaScript or media140 queries may change. Keep fallback values deliberate.141- Use cascade layers (`@layer reset, base, components, utilities;`) to make142 precedence explicit for resets, tokens, components, and overrides. Do not use143 specificity wars as a layer substitute.144- Use container queries for components that respond to their container, not the145 viewport. Keep media queries for viewport, device, and user-preference concerns146 such as `prefers-reduced-motion`, `prefers-color-scheme`, or coarse pointers.147- Use logical properties (`margin-inline`, `padding-block`, `inset-inline`,148 `border-start-start-radius`) when layout should survive writing-mode or149 direction changes.150- Use Flexbox for one-dimensional alignment and Grid for two-dimensional layout.151 Avoid float/table layout except for true legacy constraints.152- Use native CSS nesting only when local browser support or the build pipeline153 supports it; keep nesting shallow and avoid hiding selector specificity.154- Represent design tokens close to their consumption: global primitives on155 `:root`, semantic tokens in theme scopes, and component tokens on component156 roots. Avoid magic numbers unless the value is truly one-off.157- Prefer semantic class names and component boundaries over selectors coupled to158 deep DOM structure.159160## Modern SCSS Guidance161162- Use the Sass module system. Prefer `@use` for consuming variables, mixins, and163 functions, and `@forward` for exposing a curated module API. Avoid adding new164 `@import`; current Sass treats it as deprecated and it will be removed in a165 future major Dart Sass release.166- Keep module members namespaced (`theme.$space-2`, `@include buttons.reset`) so167 origins stay clear. Use `as *` only for a small, intentional compatibility168 layer.169- Use `$variables` for compile-time constants and CSS custom properties for170 runtime theming. Do not replace runtime `var(--token)` values with Sass171 variables unless the value never changes in the browser.172- Use mixins for repeated declaration groups that need parameters or feature173 gates. Avoid mixins that hide large, unrelated blocks of CSS.174- Use functions for pure value calculations. Keep side effects and emitted CSS in175 mixins, not functions.176- Use maps for related token sets and generated variants; validate expected keys177 where the project has patterns for doing so.178- Use partials (`_tokens.scss`) for files loaded by modules. Keep entrypoints179 explicit (`app.scss`, `index.scss`) and avoid accidental emitted CSS from helper180 files unless the module is meant to emit it.181- Use interpolation (`#{$name}`) sparingly for generated selectors, custom182 property names, or asset paths. Avoid interpolation that makes selector search183 and refactoring unreliable.184- Treat Sass as a build dependency. Update scripts, bundler config, Docker/CI, and185 generated output policy when introducing it.186187## Integration Patterns188189- **HTML pages:** link compiled CSS through `<link rel="stylesheet">` in the190 intended order. Keep critical inline styles minimal and avoid duplicating large191 rules across pages.192- **JavaScript/TypeScript apps:** use existing bundler conventions for CSS193 imports, CSS modules, extracted CSS, PostCSS, or CSS-in-JS. Load194 [`javascript-typescript-engineering`](../javascript-typescript-engineering/SKILL.md)195 when package scripts, lockfiles, Vite/Webpack/Next/etc. config, or TypeScript196 component code changes.197- **Python web apps:** keep templates responsible for markup and class hooks;198 serve styles through the framework's static asset path such as Django static199 files or Flask `url_for("static", ...)`. Load200 [`python-engineering`](../python-engineering/SKILL.md) when routes, templates,201 packaging, or framework config changes.202- **PHP/Smarty templates:** templates own semantic markup and stable class hooks;203 styles flow through the host or framework asset path.204- **Rust Leptos/Axum apps:** keep Leptos components deterministic for SSR and205 hydration, use class/style bindings only where they produce stable markup, and206 serve compiled assets through the app's Trunk/cargo-leptos/Axum static route.207 Load [`rust-async-web`](../rust-async-web/SKILL.md) when server functions,208 hydration, routing, WASM targets, or Axum static-file behavior changes.209- **Tailwind and other utility CSS:** apply the decision and source-detection210 rules above, then follow the local framework, version, entrypoint, token, and211 component conventions. Do not replace established utilities with handcrafted212 CSS, or vice versa, without an explicit migration goal.213- **CSS-in-JS:** follow the existing extraction/runtime model. Keep dynamic values214 bounded, avoid per-render stylesheet churn, and verify SSR/hydration behavior215 when styles are generated server-side.216217## Accessibility, Responsive Design, And Performance218219- Preserve visible focus states, hover/focus/active/disabled distinctions,220 contrast, text resizing, zoom, reduced-motion preferences, and hit-target sizes.221- Responsive behavior should come from fluid layout, intrinsic sizing, container222 queries, and minimal breakpoints before adding many viewport-specific overrides.223- Use `rem`, `em`, percentages, viewport/container units, and logical properties224 where they preserve user settings and layout direction.225- Keep animations cheap and optional: prefer transform/opacity, avoid layout226 thrash, and respect `prefers-reduced-motion`.227- Avoid loading unused CSS. Check code splitting, extraction, purging/content228 scanning, and critical CSS only within the project's existing build model.229- Check browser compatibility against the project's stated support matrix,230 Browserslist, framework baseline, or test browsers. Consult current official231 documentation for version-sensitive Tailwind, framework, Sass, or build-tool232 behavior.233234## Anti-Patterns235236- Introducing Tailwind for one component or isolated fix in a repository with237 an established styling system.238- Running Tailwind and CSS/SCSS as overlapping systems without explicit ownership239 or a bounded migration plan.240- Mixing configuration, directives, plugins, or migration advice from different241 Tailwind major versions; or combining current Tailwind v4 with Sass, Less, or242 Stylus without contrary evidence from the installed version's official docs.243- Constructing utility class fragments dynamically, then using a broad safelist244 as a substitute for finite mappings to complete class strings.245- Accumulating arbitrary values, global `!important`, or one-off plugins instead246 of extending shared tokens and resolving the actual cascade boundary.247- Rebuilding every utility string with `@apply`, or using utilities in isolated248 CSS modules/component style blocks without the installed version's required249 reference/build context.250- Ignoring Preflight or other base-style effects on existing elements and251 third-party widgets.252- Converting to SCSS by default when CSS custom properties, `@layer`, native253 nesting, or container queries are enough.254- Adding `@import` to new Sass code instead of `@use`/`@forward`.255- Using Sass variables for values that must change at runtime in the browser.256- Deep nesting that hides specificity and makes overrides brittle.257- Global selectors, resets, or utility overrides that leak outside their intended258 layer or component boundary.259- Copying class strings, breakpoints, colors, or z-index values instead of using260 existing tokens and conventions.261- Hiding behavior-critical state only in color or motion without accessible text,262 focus, or reduced-motion alternatives.263- Treating formatter/linter success as proof that layout, cascade, accessibility,264 or browser compatibility is correct.265266## Security And Evidence267268Load [`security-review`](../security-review/SKILL.md) when styling work touches269CSP, external fonts/assets, user-generated HTML/CSS, template rendering, Markdown270or rich-text styling, inline styles with untrusted values, URL-valued CSS,271uploaded assets, or SSR injection paths. Use272[`security-review-evidence`](../security-review-evidence/SKILL.md) when reports273include screenshots, DOM excerpts, network traces, tokens, private URLs, or other274sensitive evidence.275276## Successful Use277278The final handoff states the styling system and installed Tailwind major detected,279the Tailwind-vs-CSS-vs-SCSS decision, files changed, build/tooling and source-scan280impact, validation commands run, visual or browser checks performed, and281remaining cascade/reset, browser, accessibility, and performance risk. Omit282Tailwind-specific details when Tailwind is not part of the task.