Skip to content

Is is possible to exclude the base layer? #17063

Answered by wongjn
arthurmeeh 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: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by arthurmeeh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants