tailwind customizations
Styling
Tailwind is great and ust a few customizations can make it even better. Most of these are embedded in this preset.
Pixel widths
Tailwind uses an index based scale which can be cumbersome to memorize, hover over in a code editor, or print out for reference. Our team has used px scale and it's easier to remember and for new devs to onboard faster. Compare p-36px
vs p-9
, it's slightly more effort to nudge something but autocomplete works well and mostly it's adding 4-8px at a time.
Not just me
These two tweets convinced me, one from the creator of tailwindcss and one from vanilla extract and css modules. Note that the creator of tailwind didn't remember the scale value off the top of his head -- because he is human like most of us.
There was a little learning curve, but I like it now that Iām used to it. Also mt-8 is 32px š
ā Jason Beggs (@jasonlbeggs) January 13, 2020
After working with an abstracted scale for years, I've ended up feeling like the abstraction didn't actually buy me anything and only served to slow me down and make it difficult to predict what would be on screen. The main benefit was having a limited scale, which we still have.
ā Mark Dalgleish (@markdalgleish) November 24, 2021