Skip to content

Tailwindcss 4 comes with too much defaults when all I need is utilities (migration from v3) #15797

Answered by vdegenne
vdegenne asked this question in Help
Discussion options

You must be logged in to vote

I found an opt-in solution to this by selectively disabling all predefined features (Thanks @wongjn to show me how).

@import 'tailwindcss';

@theme {
	--animate-*: initial;
	--aspect-*: initial;
	--blur-*: initial;
	--breakpoint-*: initial;
	--color-*: initial;
	--container-*: initial;
	--default-*: initial;
	--drop-*: initial;
	--ease-*: initial;
	--font-*: initial;
	--font-weight-*: initial;
	--inset-shadow-*: initial;
	--leading-*: initial;
	--perspective-*: initial;
	--radius-*: initial;
	--shadow-*: initial;
	--text-*: initial;
	--tracking-*: initial;
}

Now during development if you ever need a set, let say text sizes you would comment --text-*: initial to make the classes available …

Replies: 3 comments 11 replies

Comment options

You must be logged in to vote
5 replies
@vdegenne
Comment options

@wongjn
Comment options

@vdegenne
Comment options

@wongjn
Comment options

@vdegenne
Comment options

Comment options

You must be logged in to vote
1 reply
@vdegenne
Comment options

Comment options

You must be logged in to vote
5 replies
@vdegenne
Comment options

@wongjn
Comment options

@vdegenne
Comment options

@wongjn
Comment options

@vdegenne
Comment options

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