Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

A concrete example that seems like a no-brainer to me: let's add a little padding to the top and bottom of an element. "py-2" Done. In CSS, specifying padding (or margins) is 4 values... except I forget which is the first one. And what units should I use... px, pt, rem, em. Inline, same-page style, or an external .css file? If not inline, what should I name the class? Vanilla CSS literally requires 10x more time and mental attention.


You can using padding-inline and padding-block with var(--spacing-2).

Tailwind is styling utility classes and design tokens in one. There are premade design tokens you can use the CSS styling though.


> "py-2" Done. In CSS, specifying padding (or margins) is 4 values... except I forget which is the first one.

False dichotomy. You are not stuck between tailwind and "Vanilla CSS", and one can solve the issue you are presenting with any reasonable set of SASS mixins.

> If not inline, what should I name the class?

Also solvable with good old SASS.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: