"This can be easily solved with good project organization"
"All you have to do is closely mirror your UI components, pages, fragments, whatever, with the relevant CSS files. Then if you add or remove something in the markup, you add or remove it in the corresponding styles."
Super simple. It is what it is and powerful etc, but simple? I have given up. I just use the minimum web tech to get by.
Yeah, "remember to keep these two files in sync by hand" is the opposite of simple. Like c++ header files, without the benefit of a compiler that will complain at you when you get it wrong.
"All you have to do is closely mirror your UI components, pages, fragments, whatever, with the relevant CSS files. Then if you add or remove something in the markup, you add or remove it in the corresponding styles."
Super simple. It is what it is and powerful etc, but simple? I have given up. I just use the minimum web tech to get by.