Replies: 8 comments 2 replies
-
Seems to work as expected. CSS variables only get output in the compiled CSS if they are used. The They would be output if you used them in CSS as a value like: selector {
property: var(--breakpoint-pc);
} Or in a utility class like If you still need them output in the CSS regardless of usage, you can use the @import "tailwindcss";
@theme static {
--breakpoint-base: 450px;
--breakpoint-tablet: 900px;
--breakpoint-mobile: 450px;
--breakpoint-pc: 1200px;
}
@theme {
--spacing: 1px;
--color-transparent: transparent;
--color-white: #ffffff;
…
}
This could happen if you are using default Tailwind breakpoints in conjunction with your own. As per the documentation:
Or if converting to |
Beta Was this translation helpful? Give feedback.
-
![]() It's included, but the style isn't applied. It seems there's another cause, but I have no idea. |
Beta Was this translation helpful? Give feedback.
-
Consider providing a git repo that reproduces the issue and we can take a look for you. |
Beta Was this translation helpful? Give feedback.
-
Off: Although it might not be related to the issue, it's worth noting that you are declaring
@theme {
--breakpoint-*: initial;
--breakpoint-base: 450px;
--breakpoint-tablet: 900px;
--breakpoint-mobile: 450px;
--breakpoint-pc: 1200px;
} Tip To ensure better accessibility, consider using |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Converted this to a discussion because this does seem to work as expected. If you are still running into issues @thyeone then please provide a minimal reproduction repo so we can take a look. |
Beta Was this translation helpful? Give feedback.
-
if I use the old v3 style, the values are inserted directly:
|
Beta Was this translation helpful? Give feedback.
-
ah, I figured it out! I am transitioning the project, and it still has a tailwind.config file, which had a I removed that, and the breakpoints now work. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
What version of Tailwind CSS are you using?
For example: v4.1.12
What build tool (or framework if it abstracts the build tool) are you using?
For example: Next.js 14.2.25
What version of Node.js are you using?
For example: v22.18.0
What browser are you using?
For example: Chrome, Safari
What operating system are you using?
For example: macOS
Describe your issue
Also, breakpoint styles are not applied
globals.css
Beta Was this translation helpful? Give feedback.
All reactions