Skip to content

wagerfield/tailwind-jit-calc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tailwind JIT calc()

When using calc() within the new arbitrary value class syntax, classes are not generated when the body of the calc function contains spaces:

<div class="h-[calc(100px + 50px * 2)]">This does not work</div>
<div class="h-[calc(100px+50px*2)]">This does work</div>

Reproduction

  1. yarn && yarn dev
  2. Navigate to localhost:3000
  3. Inspect the 2 elements on the page and observe that:
    • h-[calc(100px + 50px * 2)] does not work
    • h-[calc(100px+50px*2)] does work

Solution

Remove whitespace from the contents of arbitrary class names.

About

Tailwind JIT calc() issue reproduction repo

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published