Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--*: initial; and --spacing-*: initial; doesn't remove default theme spacing classes or font classes #1133

Closed
vishucrafts opened this issue Jan 22, 2025 · 2 comments · Fixed by tailwindlabs/tailwindcss#15857
Assignees
Labels
bug Something isn't working

Comments

@vishucrafts
Copy link

What version of VS Code are you using?

For example: v1.96.4

What version of Tailwind CSS IntelliSense are you using?

0.14.1

What version of Tailwind CSS are you using?
4.0.0

What package manager are you using?

pnpm

What operating system are you using?

macOS

Describe your issue

In my global.css I have

@import 'tailwindcss';

@plugin 'tailwindcss-react-aria-components';

@theme {
	--text-*: initial;
	--spacing-*: initial;
	--font-*: initial;
	--font-weight-*: initial;

	--font-sans: var(--font-sans);
	--font-mono: var(--font-mono);

	--font-weight-normal: 400;
	--font-weight-medium: 700;
	--font-weight-bold: 900;

	/* @link https://utopia.fyi/type/calculator?c=320,16,1.125,1240,18,1.2,5,2,&s=0.75|0.5|0.25,1.5|2|3|4|6,s-l&g=s,l,xl,12 */
	--text--2: clamp(0.7813rem, 0.7932rem + -0.0154vw, 0.7901rem);
	--text--1: clamp(0.8889rem, 0.872rem + 0.0845vw, 0.9375rem);
	--text-0: clamp(1rem, 0.9565rem + 0.2174vw, 1.125rem);
	--text-1: clamp(1.125rem, 1.0467rem + 0.3913vw, 1.35rem);
	--text-2: clamp(1.2656rem, 1.1424rem + 0.6163vw, 1.62rem);
	--text-3: clamp(1.4238rem, 1.2429rem + 0.9046vw, 1.944rem);
	--text-4: clamp(1.6018rem, 1.3475rem + 1.2713vw, 2.3328rem);
	--text-5: clamp(1.802rem, 1.4551rem + 1.7345vw, 2.7994rem);

	/* @link https://utopia.fyi/space/calculator?c=320,16,1.125,1240,18,1.2,5,2,&s=0.75|0.5|0.25,1.5|2|3|4|6,s-l&g=s,l,xl,12 */
	--spacing-3xs: clamp(0.25rem, 0.2283rem + 0.1087vw, 0.3125rem);
	--spacing-2xs: clamp(0.5rem, 0.4783rem + 0.1087vw, 0.5625rem);
	--spacing-xs: clamp(0.75rem, 0.7065rem + 0.2174vw, 0.875rem);
	--spacing-s: clamp(1rem, 0.9565rem + 0.2174vw, 1.125rem);
	--spacing-m: clamp(1.5rem, 1.4348rem + 0.3261vw, 1.6875rem);
	--spacing-l: clamp(2rem, 1.913rem + 0.4348vw, 2.25rem);
	--spacing-xl: clamp(3rem, 2.8696rem + 0.6522vw, 3.375rem);
	--spacing-2xl: clamp(4rem, 3.8261rem + 0.8696vw, 4.5rem);
	--spacing-3xl: clamp(6rem, 5.7391rem + 1.3043vw, 6.75rem);

	/* One-up pairs */
	--spacing-3xs-2xs: clamp(0.25rem, 0.1413rem + 0.5435vw, 0.5625rem);
	--spacing-2xs-xs: clamp(0.5rem, 0.3696rem + 0.6522vw, 0.875rem);
	--spacing-xs-s: clamp(0.75rem, 0.6196rem + 0.6522vw, 1.125rem);
	--spacing-s-m: clamp(1rem, 0.7609rem + 1.1957vw, 1.6875rem);
	--spacing-m-l: clamp(1.5rem, 1.2391rem + 1.3043vw, 2.25rem);
	--spacing-l-xl: clamp(2rem, 1.5217rem + 2.3913vw, 3.375rem);
	--spacing-xl-2xl: clamp(3rem, 2.4783rem + 2.6087vw, 4.5rem);
	--spacing-2xl-3xl: clamp(4rem, 3.0435rem + 4.7826vw, 6.75rem);

	/* Custom pairs */
	--spacing-s-l: clamp(1rem, 0.5652rem + 2.1739vw, 2.25rem);
}

When I use --text-*: initial it removes default text sizing utilities however --spacing-*: initial doesn't remove default spacing utilities for padding, margins, space etc. Tailwind doesn't generate old classes for example px-2 doesn't work but it still shows up in suggestions.

I also noticed --font-*: initial;, --font-weight-*: initial; don't remove default utility suggestions either.

--*: initial; should remove all default theme classes where necessary.

@FredericoC
Copy link

Can confirm;

Image

@thecrypticace
Copy link
Contributor

thecrypticace commented Jan 28, 2025

Hey! This will be fixed in the next patch release of Tailwind CSS. Thanks for reporting it. ✨

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants