Remove VH and use DVH/LVH/SVH units #8216
Replies: 9 comments 7 replies
-
Hey there, just wanna revive this discussion. I think it is reasonable to leave vh in while adding dvh/lvh/svh, just for the sake of backwards compatibility |
Beta Was this translation helpful? Give feedback.
-
It's not clear in the original conversation, but the proposed for implementation units are *vh and *vw (where * one of d/l/s) |
Beta Was this translation helpful? Give feedback.
-
I was working on a design with buttons in the bottom of the viewport on mobile and would really want to be able to set the body to 100dvh. |
Beta Was this translation helpful? Give feedback.
-
I would also like to have this feature, it would be quite helpful. |
Beta Was this translation helpful? Give feedback.
-
Definitely could be cool to add these as named values to core eventually. In the mean time though you can always use these as arbitrary values: <div class="min-h-[100dvh]">
<!-- ... -->
</div> |
Beta Was this translation helpful? Give feedback.
-
You can just add a custom Tailwind utility class
|
Beta Was this translation helpful? Give feedback.
-
How about doing it like this?
|
Beta Was this translation helpful? Give feedback.
-
The current Tailwind typing seem to expect a string not a string array. Is this still safe to do? |
Beta Was this translation helpful? Give feedback.
-
All this stuff will be in the next Tailwind release for what it's worth — PR to add them by default was merged in May 👍 |
Beta Was this translation helpful? Give feedback.
-
I was reading this tweet thread https://twitter.com/housecor/status/1519286593269518338 and it seems like using the VH is a bad idea and should be avoided.
Maybe replace it with lvh ? (and keep the classes the same) or introduce dvh/lvh/svh variances (min-h-screen / min-dvh-screen / etc)
According to the tweet thread, the vh currently works as lvh so that will be a good starting point
Beta Was this translation helpful? Give feedback.
All reactions