3 ms·
As a designer that used to make pixel perfect websites turned developer, CSS lets me offload so much of what I need in building UIs and keeps my templates/JSX a
by whytaka 6y ago
As a designer that used to make pixel perfect websites turned developer, CSS lets me offload so much of what I need in building UIs and keeps my templates/JSX as close to data representation as possible. With my components having tightly scoped CSS, the only CSS I share between my components is very universal branding settings. My class names make sense and my SCSS reads like the DOM, and the only non unique dom-selector class name is the 'active' state.
I loathe having to deal with so much layout building classes in my dom, having to swap them for responsive layouts, etc. My css determines layouts. My html presents data. It keeps my javascript very focused on function.
- runawaybottle 6y agoGood point. People that suck at css usually stick a class on everything and the templates become a mish mash of data, styles, and elements whose semantics are determined by some arbitrary class name. I love me a nice tight jsx template with maybe one or two classes sprinkled at the top level containers.
- eurasiantiger 6y agoCSS-in-JS is the biggest, stupidest mistake on the web, ever. Do not use it. Componentize using BEM classes and SCSS and your designers will love you.