Didn't find a way to convert
background-position: 0% 20%;
in tailwind
I only find these classes bg-{side}
any help is appreciated
Didn't find a way to convert
background-position: 0% 20%;
in tailwind
I only find these classes bg-{side}
any help is appreciated
If you're using the new just-in-time (JIT) mode, you can generate this class on the fly.
Then you can just use: bg-[0% 20%]. The square brackets just mean that this is an arbitrary value that isn't in the config.
Here are the docs for JIT mode.
JIT for tailwind v3 is currently not implemented.
I was able to achieve
background-position: -200% 0%;
or
background-position-x: -200%;
background-position-y: 0%
by doing
bg-[left_calc(-200%)_top_calc(0%)]
looks like background position, background image and background size cannot accept arbitrary values, I did try on the Tailwind Play without any luck: https://play.tailwindcss.com/MkuaNCxvFs?layout=horizontal