Replies: 1 comment 3 replies
-
There is currently no CSS API for registering custom dynamic variants. However, we can utilize the legacy JavaScript system to do this via Have a JavaScript file as follows: // plugin.js
const plugin = require('tailwindcss/plugin');
module.exports = plugin(({ matchVariant }) => {
matchVariant('@max-h', value => `@media (max-height: ${value})`);
}); In your input CSS file: @import "tailwindcss";
@plugin "./path/to/plugin.js"; Then in your markup: <div class="@max-h-[680px]:bg-red-500"> |
Beta Was this translation helpful? Give feedback.
3 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.
-
I have a record like this
how can I improve it so that I can write @max-h-[value] for example @max-h-[680px] and it works with dynamic values
Beta Was this translation helpful? Give feedback.
All reactions