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

Can't unset font-weights in v4 #15811

Closed
idan-faibish opened this issue Jan 24, 2025 · 5 comments · Fixed by #15857
Closed

Can't unset font-weights in v4 #15811

idan-faibish opened this issue Jan 24, 2025 · 5 comments · Fixed by #15857

Comments

@idan-faibish
Copy link

What version of Tailwind CSS are you using?

v4.0.0

What build tool (or framework if it abstracts the build tool) are you using?

vite v6.0.3

What version of Node.js are you using?

v20.13.1

What browser are you using?

Chrome

What operating system are you using?

macOS

Describe your issue

I just started to use tailwind (jumped straight to v4) and I'm building my existing design system under my css file. I'm not sure what I'm doing wrong but I tried plenty of options and I just cant to unset all the existing tailwind's font-weights.

@theme {
    /* tried to unset this */
    --font-*: initial;
    /* and also this */
    --font-weight-*: initial;

    --font-weight-extraBold: 800;
    --font-weight-bold: 700;
    --font-weight-semiBold: 600;
    --font-weight-normal: 400;
}

here it what I get on intellisense, it even multiplies the stuff

Image

@wongjn
Copy link
Contributor

wongjn commented Jan 24, 2025

--font-weight-*: initial; should work, as exhibited in this Tailwind Play.

The extra:

--font-weight-extraBold: 800;
--font-weight-bold: 700;
--font-weight-semiBold: 600;
--font-weight-normal: 400;

After is adding them back in

@philipp-spiess
Copy link
Member

@idan-faibish Is the issue here that you're seeing these in IntelliSense even if you have removed it? In that case this issue is likely a duplicate of tailwindlabs/tailwindcss-intellisense#1133 and got to do with a bug in IntelliSense. We'll look into it next week!

@idan-faibish
Copy link
Author

--font-weight-*: initial; should work, as exhibited in this Tailwind Play.

The extra:

--font-weight-extraBold: 800;
--font-weight-bold: 700;
--font-weight-semiBold: 600;
--font-weight-normal: 400;
After is adding them back in

well actually you just strengths what I said. we still see all the options in intellisense (in the linked that you attached)

Image

@idan-faibish
Copy link
Author

@idan-faibish Is the issue here that you're seeing these in IntelliSense even if you have removed it? In that case this issue is likely a duplicate of tailwindlabs/tailwindcss-intellisense#1133 and got to do with a bug in IntelliSense. We'll look into it next week!

if I understand correctly, then yes, it is probably the same issue I guess 🤷🏻

what I noticed is that when unsetting the font-weights, only intellisense shows them but when trying to apply them (for example: font-extrabold) it does nothing, so it means that the style is indeed not exists which is great.

so I think it is indeed just an intellisense issue

@thecrypticace
Copy link
Contributor

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
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants