|
|
|
|
|
by ookblah
1719 days ago
|
|
padding 48, on small screens vertical padding 32 and horizontal padding 24, center styled? try doing that inline.... i always see this and never understand the pushback, or have people never worked on large apps spanning hundreds/thousands of components and have to maintain it. it's a godsend when working on older components and i don't have to dig thru some other css file and figure out exactly how and why i named it. inline css doesn't allow to do transitions, animations, responsive breakpoints, etc. everything is there is contextual and i never break flow going from design to implementation. you still can have global styles or can have a master design guide. |
|
My point was the end result is the same as inline, yes it's less verbose than inline but it's more obscure unless you have all the shorthand class names memorized. It's just a messy string, can you even make that type safe?
> and i don't have to dig thru some other css file
That's a separate issue solved via CSS-in-JS in general. I believe your styles should be isolated to your component, preferably in the same file, not global. That doesn't mean we have to shove styling in the className string attribute.