Re:CSS Utility Classes and “Separation of Concerns” (2017)
by kian on Saturday November 16, 2019 @01:39PM
(#21554197)
In programming, this problem would be solved with something like higher order functions or parametric data types, allowing us to both abstract out the commonalities and maintain incredibly specific, easily modifiable, highly customized functionality. Is there an analog in the CSS world?
[ Parent
| on HN ]
Re:CSS Utility Classes and “Separation of Concerns” (2017)
by danpeddle on Saturday November 16, 2019 @02:16PM
(#21554367)
Placeholders maybe? https://sass-lang.com/documentation/style-rules/placeholder-...
I use these a bit when I’m being more thoughtful, it’s a nice way to think about creating chunks of style that don’t get included in the output, bit surprised they weren’t mentioned yet.
Re:CSS Utility Classes and “Separation of Concerns” (2017)
by chrisweekly on Saturday November 16, 2019 @02:48PM
(#21554522)
There doesn't need to be, given CSS-in-JS!
Re:CSS Utility Classes and “Separation of Concerns” (2017)
by koboll on Saturday November 16, 2019 @03:03PM
(#21554620)
It's wild to me that most of the discourse around CSS-in-JS is about personal preference for how separation of concerns should be when its biggest advantage is totally orthogonal to that--it almost completely solves the issues of scope, specificity, and mapping styles to markup that so many different libraries and methodologies have been invented to cope with over the years.
Re:CSS Utility Classes and “Separation of Concerns” (2017)
by chrisweekly on Saturday November 16, 2019 @04:38PM
(#21555136)
upvoted and agreed