Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Changes @import paths to be consumer-facing
Especially fixes the code example for disabling Preflight.
  • Loading branch information
wongjn authored Jan 23, 2025
commit e8b3d8155bd506a94434bf9838531ef0073b1e45
18 changes: 9 additions & 9 deletions src/docs/preflight.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ When you import `tailwindcss` into your project, Preflight is automatically inje
/* [!code filename:CSS] */
@layer theme, base, components, utilities;

@import "./theme.css" layer(theme);
@import "tailwindcss/theme.css" layer(theme);
/* [!code highlight:2] */
@import "./preflight.css" layer(base);
@import "./utilities.css" layer(utilities);
@import "tailwindcss/preflight.css" layer(base);
@import "tailwindcss/utilities.css" layer(utilities);
```

While most of the styles in Preflight are meant to go unnoticed—they simply make things behave more like you'd expect them to—some are more opinionated and can be surprising when you first encounter them.
Expand Down Expand Up @@ -216,9 +216,9 @@ By default, this is what `@import "tailwindcss";` injects:
/* [!code filename:CSS] */
@layer theme, base, components, utilities;

@import "./theme.css" layer(theme);
@import "./preflight.css" layer(base);
@import "./utilities.css" layer(utilities);
@import "tailwindcss/theme.css" layer(theme);
@import "tailwindcss/preflight.css" layer(base);
@import "tailwindcss/utilities.css" layer(utilities);
```

To disable Preflight, simply omit its import while keeping everything else:
Expand All @@ -227,7 +227,7 @@ To disable Preflight, simply omit its import while keeping everything else:
/* [!code filename:CSS] */
@layer theme, base, components, utilities;

@import "./theme.css" layer(theme);
@import "./preflight.css" layer(base); /* [!code --] */
@import "./utilities.css" layer(utilities);
@import "tailwindcss/theme.css" layer(theme);
@import "tailwindcss/preflight.css" layer(base); /* [!code --] */
@import "tailwindcss/utilities.css" layer(utilities);
```