Re:CSS Utility Classes and “Separation of Concerns” (2017)
by meerita on Saturday November 16, 2019 @04:24PM
(#21555049)
Let me see this:
.body--homepage
.searchbox { color: red }
but, you use .searchbox on other section and you want it green
.body--article
.searchbox { color: yellow }
To me this sounds an akward usecase but you can do this with functional classes no problem: just write the class to the point you want to change on whatever place you are instead of relegating these conditionals to the CSS.
.body--homepage .searchbox { color: red }
but, you use .searchbox on other section and you want it green
.body--article .searchbox { color: yellow }
To me this sounds an akward usecase but you can do this with functional classes no problem: just write the class to the point you want to change on whatever place you are instead of relegating these conditionals to the CSS.