Skip to content

Guidance on using arbitrary values vs design system tokens in Tailwind #18748

Answered by wongjn
extmadhavi asked this question in Help
Discussion options

You must be logged in to vote

If you are using an arbitrary value in note than one file, it may be a good idea to extract it to a theme token.

Ideally though, you'd want to reason what the value represents. I.e. if it is a width dictated from a design, then yes, a spacing/container variable would be best.

Or is it a sum of smaller widths and paddings and margins? If so, I'd use CSS variables in one source of truth to avoid "magic" numbers.

Replies: 1 comment 1 reply

Comment options

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

Answer selected by extmadhavi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants