4 ms·
But why would you want to write CSS like that? Better off learning CSS and using it more effectively rather than single attributes
by youngtaff 3y ago
But why would you want to write CSS like that?
Better off learning CSS and using it more effectively rather than single attributes
- tuyiown 3y agoI've been doing front for 18 years and I've sill not figure out how to maintain code with the HTML dom structure and CSS rules coupling. Touch either side, you have to understand the entire codependencies, inheritance rules and edges cases to make any predictions on what will actually happen. You always can do edit/fix fast cycles, but it always ends up complicating initial code while eroding overall quality. Good practices to make to whole thing predictable generally fails on edges cases. Long story short, having each attributes defined, used and moved around independently really really simplify the whole experience, without leaving much things to regret.
- incrudible 3y agoI have the opposite question: If you are already using templating/components, why would you want to use something like CSS in the first place? I do not find it to be an effective tool, at all. It is an optimization on dimensions that do not really matter to me, and a pessimization on the dimensions that do matter, a lot.
- youngtaff 3y agoYou’re going to use CSS anyway because that’s how things are styled Essentially the discussion is around how should you use it - define it as inline attributes on individual elements - use some thing like Andy Bell’s CUBE approach to define styles for layout and components With something like Andy’s approach you’ll end up with far less CSS, it’ll adapt to devices and you won’t actually have to write much CSS for new components
- incrudible 3y ago> You’re going to use CSS anyway because that’s how things are styled I am speaking in principle. Im am not even sure if inline styles are correctly referred to as CSS, as there is no cascading and no sheet. Aren’t they just styles? With templates/components, I do not find myself writing a lot of style code at all, plus they remain more composable. The segregation into CSS, despite its inevitable coupling to the structure of the document, has no value to me. I also do not buy the adaptation argument. I can adapt in code just fine, in fact it is necessary because proper adaptation needs more than just styling.