Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

calc(100vh - 44px) not working in TailwindCSS 3

I tried all of these:

<ul className="overflow-y-auto bg-surface-50 rounded-b-lg  h-[calc(100vh_-_44px)] sm:h-fit ">
<ul className="overflow-y-auto bg-surface-50 rounded-b-lg  h-[calc(100vh-44px)] sm:h-fit ">

But when tailwind compiles, I still see no class h-[calc(100vh-44px)] and also no styling.

like image 903
سعيد Avatar asked Dec 03 '25 17:12

سعيد


1 Answers

So it turns out the extra space after sm:h-fit and before h-[calc(100vh_-_44px)] was the culprit. This fixed it - removing all unnecessary spaces:

<ul className="h-[calc(100vh_-_44px)] sm:h-fit overflow-y-auto bg-surface-50 rounded-b-lg">
like image 161
سعيد Avatar answered Dec 05 '25 11:12

سعيد



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!