13 ms·
It’s not clear to me from the readme why this is useful. .a and .b identify different groups of elements. The fact they’re both coloured red is incidental, cir
by the_other 3y ago
It’s not clear to me from the readme why this is useful.
.a and .b identify different groups of elements. The fact they’re both coloured red is incidental, circumstantial and likely temporary. Refactoring to save a couple of lines makes the code less deleteable and thus harder to maintain.
- keepamovin 3y agoYeah, that’s fair enough. I suppose if you want to keep all the selectors fully ‘denormalized’ and independent, at the expense of duplication, then you probably don’t wanna link them together by factoring out commonalities like this seems to do. This has benefits indeed. I guess what I was looking for was a different type of benefits, more achieved through normalizing the CSS. My CSS was just like accreted overtime and I just couldn’t be bothered to like get the overall picture myself, and re-organize — so I wanted to reduce some of the entropy and redundancy and increase organization, so it would be clearer. I think from another point of view having something that’s clearer and tighter is more maintainable. All depends on what you want I suppose. I was also hoping that I would be able to change a color in one place and it would update across many selectors. And that’s one of the benefits that a more normalized factored structure gives. Ann interesting dichotomy, your comment raises between fully denormalized and easy to change a single thing, and what I am trying to achieve in this case, and that’s more succinct and structured with related parts proximal. A more ‘normalized’ CSS haha! :)
- andful 3y agoI would treat this tool similarly to a minifier. It reduces size and bandwidth at the cost of legibility. It should be a stage in the deployment pipeline, but not a way to format your own code.
- holoduke 3y agoAdd it to a bundler like parceljs. Minifies and optimizes for production. Our dev css file is 40kb. Optimized production version 10kb (example)
- the-smug-one 3y agoIs that an example of using this tool?