Skip to content

Tailwindcss-jit impact #360

Answered by ben-rogerson
vjpr asked this question in General
Mar 18, 2021 · 3 comments · 4 replies
Discussion options

You must be logged in to vote

Since v2.5.0, twin now has support for the features added with the tailwind JIT mode.

Arbitrary values - Supported since v2.5.0 🎉

tw`top-[calc(100vh - 2rem)]`

// ↓ ↓ ↓ ↓ ↓ ↓

;({ top: 'calc(100vh - 2rem)' })

Similar twin’s “short css” syntax, arbitrary values use square brackets to allow custom css values instead of classes built from your tailwind.config.js.

This is a good solution for those unique “once off” values that every project requires which you may not want to add to your tailwind.config.js.

Read more about arbitrary values →

Important prefix - Supported since v2.5.0 🎉

Use a bang ! prefix to add important styles:

tw`!block`;

// ↓ ↓ ↓ ↓ ↓ ↓

;({ "display": "block !important" })

S…

Replies: 3 comments 4 replies

Comment options

You must be logged in to vote
1 reply
@behzadmehrabi
Comment options

Comment options

You must be logged in to vote
1 reply
@harrytran998
Comment options

Answer selected by ben-rogerson
Comment options

You must be logged in to vote
2 replies
@ben-rogerson
Comment options

@ben-rogerson
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
5 participants