Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any way to calc width on tailwind?

Tags:

tailwind-css

Is there a way to make width using calc() on tailwind?

width: calc(100% - 40px)

without making separate values on the configs file each time?

like image 431
usrnvm43894 Avatar asked Sep 15 '25 22:09

usrnvm43894


1 Answers

If you only need this value once, and the Tailwind version you're using supports Just-in-Time mode, I would suggest you to use the arbitrary values feature.

<div class="w-[calc(100%-40px)]"></div>

Depending on your use case, there might be better solutions.

like image 193
Joren Avatar answered Sep 17 '25 20:09

Joren