Skip to content

Is is possible to exclude the base layer? #17063

Answered by wongjn
ccoder1233 asked this question in Help
Discussion options

You must be logged in to vote

As per the documentation:

Disabling Preflight

If you'd like to completely disable Preflight—perhaps because you're integrating Tailwind into an existing project or you'd prefer to define your own base styles—you can do so by importing only the parts of Tailwind that you need.

By default, this is what @import "tailwindcss"; injects:

@layer theme, base, components, 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:

 @layer theme, base, components, utilities;

 @import "tailwindcss/theme.css" layer(theme);
-@…

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
2 replies
@vaynevayne
Comment options

@wongjn
Comment options

wongjn Mar 21, 2025
Collaborator

Answer selected by ccoder1233
Comment options

You must be logged in to vote
2 replies
@wongjn
Comment options

wongjn Mar 30, 2025
Collaborator

@Tastaturberuf
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
4 participants