Re:Bootstrap 5 will remove jQuery as a dependency
by pault on Tuesday February 12, 2019 @06:02PM
(#19148589)
CSS in JS isn't CSS. It's just SS. It ignores the best part of the language; the cascade.
[ Parent
| on HN ]
Re:Bootstrap 5 will remove jQuery as a dependency
by charrondev on Tuesday February 12, 2019 @07:26PM
(#19149175)
Or the worst from my point of view. CSS rots more than any other code in a front end codebase and the methods for static analysis are incredibly limited.
Refactoring and static analysis tools are incredibly limited or nonexistent for plain CSS or SCSS (when talking about the barriers between HTML and the stylesheet).
We do all of our new views and stylesheets using React, TypeScript, and Typestyle. As a result we can expose much controlled methods of theming and have a compiler enforced link between variables, selectors, and their usages. We can refactor easily. We can catch simple typos at compile time instead of runtime, and validate them more easily in CI.
Re:Bootstrap 5 will remove jQuery as a dependency
by pault on Tuesday February 12, 2019 @08:44PM
(#19149612)
> have a compiler enforced link between variables, selectors, and their usages.
That sounds interesting. Can you describe that in more detail?
Re:Bootstrap 5 will remove jQuery as a dependency
by chrisweekly on Tuesday February 12, 2019 @09:44PM
(#19149903)
The cascade was great for HTML in the absence of scope, which is to say in the age of documents. It's a reasonable approach to dealing with all the problems inherent in managing global state. But globals suck. In the age of components it makes little sense to cling to the cascade as if it were more than a means to an end.
Re:Bootstrap 5 will remove jQuery as a dependency
by rmrfrmrf on Tuesday February 12, 2019 @07:41PM
(#19149259)
1) it doesnt ignore it
2) anyone claiming not to have a single `style=""` attribute (which is almost as specific and 1000x less maintainable) in their code is lying
Re:Bootstrap 5 will remove jQuery as a dependency
by pault on Tuesday February 12, 2019 @08:39PM
(#19149583)
I will swear on my life that I haven't used a style attribute in the last five years. Since I started using BEM for namespacing I have had a very easy time keeping my CSS clean and maintainable. I won't deny others their opinions, though.
Re:Bootstrap 5 will remove jQuery as a dependency
by chrisweekly on Tuesday February 12, 2019 @10:01PM
(#19149980)
BEM is a decent convention for old-school, global document styling, in the absence of scope. But it's also manual, error-prone, and verbose, making it a poor substitute for actual namespacing provided by components. I sympathize with your resistance to css-in-js; I've been doing webdev since 1998 and only really embraced it in the last couple years. I'm reminded of quotes like
"The difficulty lies not so much in new ideas, but in escaping the old."