Tailwind CSS

tailwind/no-preprocessor

Do not run Tailwind CSS 4 through Sass, Less or Stylus; use plain CSS with native nesting and variables.

umiarkowanastatycznefe-tailwind

Dlaczego

Tailwind 4 is itself the CSS build step: it bundles imports, handles nesting and exposes the theme as CSS variables. Tailwind's documentation says it is not designed to run behind a preprocessor; mixing them causes broken @import resolution, Sass errors on Tailwind syntax (@theme, @utility, --spacing(4)) and two build steps doing the same work.

Poprawka

Rename the Tailwind entry from .scss to .css and replace Sass features with CSS: nesting is native, $variables become @theme or :root custom properties, mixins become @utility or components, @use partials become @import "./file.css". Keep Sass only for an old part of the code base that does not use Tailwind, and plan its removal.

Przykłady

// bad: src/main.scss in a project with tailwindcss 4 and sass
@import "tailwindcss";
$brand: #0a7a3e;
// good: src/main.css
@import "tailwindcss";
@theme { --color-brand-600: #0a7a3e; }

Źródła

Fakty

Identyfikator
tailwind/no-preprocessor
Waga
umiarkowana
Sprawdzanie
statyczne sprawdzane w kodzie źródłowym przez audit
Dotyczy plików
project
Tylko w projektach z
tailwind
Uczy jej skill
fe-tailwind Tailwind CSS
Od wersji
0.1.0

Plik reguły na GitHubie

Przeczytaj w terminalu

npx github:dawidolko/frontend-skills explain tailwind/no-preprocessor