No longer possible to define a custom background image and a background size to go with it? #16123
-
In v3, it wsa extremely easy to define a custom background image along with the proper background size for it - which of course needs to be done when using svgs as icons or images, in a fashion similar to this:
which could then be trivially referenced with As far as I can tell, this is no longer possible in v4? I tried the following:
but that doesn't work. I can make it work with declaring a separate utility as in:
but then the great benefits of ensuring they are referenced as one are lost. It's of course possible to solve this as follows:
but then I loose the ability to reference the background-image as a theme-component at all? Am I missing something fundamental here or is this a design choice in v4? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
There is no defining dynamic @utility bg-* {
background-size: --value(--background-size-*)
} This will make |
Beta Was this translation helpful? Give feedback.
-
Thanks for the quick reply - that's actually exceedingly clever and was exactly what I was looking for. Thanks! |
Beta Was this translation helpful? Give feedback.
There is no defining dynamic
background-size
utility classes via theme configuration but you can re-add it:This will make
bg-main
apply bothbackground-size
andbackground-image
: https://play.tailwindcss.com/dlNRZW5crj?file=css