4 ms·
> Step 2 demands there be a way for one developer to control the global namespace I mean, I just prepend all my component class names with my library name or a
by nawgz 5y ago
> Step 2 demands there be a way for one developer to control the global namespace
I mean, I just prepend all my component class names with my library name or a shorthand acronym, so 100% of my styles are like `.NawgzInput {}` or `.NawgzGraphNode {}`
I have never seen the limitation to this approach (i.e. the ends of its ability to scale), so long as you don't pick a super generic prefix. So to hear you assert this approach is "completely impractical" to someone who has used it to build their own component library that every application they build is entirely comprised of.. rings hollow
- shadowgovt 5y agoYou're basically hand-rolling the prefix-garbage solution the compiler tool I've seen does. That's the best I think we have now. It's not good (i.e. decreases readability), and it's not universal (there are definitely component frameworks out there where the classes are just named "table" and "button").
- nawgz 5y ago> You're basically hand-rolling the prefix-garbage solution the compiler tool I've seen does. Except it's incredibly easy to debug and avoids most of your complaints about the solution. Anyways, fair enough, I can confess that there is probably another ideal world that has better viewport styling. But CSS is giving us incredible flexibility, and just like JS, its warts can be worked around very easily and deliver you a powerful, useful, simple set of capabilities.