|
|
|
|
|
by pjaoko
59 days ago
|
|
> Selectors are a global namespace. Imagine if every variable and function in your favorite programming languages were global and so had to be unique. A selector is not not a variable or a function. CSS has functions (e.g translate) and it has variables, which are both distinct concepts in the language from selectors. > No modules or namespaces.
CSS is not supposed to be a turing complete general purpose programming language. Why would you need namespaces and modules to style up HTML tags? |
|
One of my earliest webdev jobs was at a company whose product was a widget you could add to your site by adding our `<script>` tag. Thus, our CSS needed to coexist with the first-party site's, not to mention any other third-party widgets on there. In other words: the same exact reason you need modules in traditional languages.