Functional utilites: Can't use --value() in media/container query
#19690
mordechaim
started this conversation in
Ideas
Replies: 2 comments
-
|
Yea, |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
This is by design right now, moved it to an ideas discussion until we figure out a proper API for this. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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?
v4.1.18
What build tool (or framework if it abstracts the build tool) are you using?
Next.js App directory - Webpack
What version of Node.js are you using?
v25.0.0
What browser are you using?
Chrome
What operating system are you using?
Windows
Reproduction URL
https://play.tailwindcss.com/FKD8ntInhO
Describe your issue
I was migrating a plugin form v3 to v4. I found the new functional utility system to be amazing and cover all the needed cases to migrate it.
The only issue I ran into was using
--value()inside the query part of a @media or @container query; the value function is included verbatim in the build instead of inlining the value.CSS mandates that it must be static so I can't just save it in a variable first.
Original JavaScript plugin
This plugin keeps a solo child centered inside a container, resizing the child to fit the container; while maintaining a fixed aspect ratio. It utilizes the
aspect-ratiocontainer query.Beta Was this translation helpful? Give feedback.
All reactions