[HN Gopher] CSS Is an Interface
___________________________________________________________________
CSS Is an Interface
Author : edent
Score : 11 points
Date : 2021-11-16 20:06 UTC (1 days ago)
(HTM) web link (ericwbailey.design)
(TXT) w3m dump (ericwbailey.design)
| crate_barre wrote:
| Proper CSS is starting to become a lost art at this point due to
| CSS-In-JS, the literal coronation of inline-styles. The ship has
| sailed on this, and the days of writing a few simple classes, and
| adding a top level parent class like <div class="dark"> and
| having all child selectors pick up on that is long gone. Now
| you'll import a <DarkButton>, or whatever the fuck way they pass
| in that theme variable. It's a massive whatever-the-fuck and
| fuck-it solution across the board with css-in-js at this point.
|
| But, it makes sense when you realize why the solution is a fuck-
| it solution. People are not great at CSS, got tired of it, and
| said fuck-it. And voila, now we have a fuck-it solution.
| have_faith wrote:
| CSS-in-JS doesn't render inline styles (usually), and many
| convert these JS declarations to plain CSS files to deliver to
| the browser. Writing CSS inside JS is convenient for many
| reasons but I'm unsure if you want to hear why.
| crate_barre wrote:
| Into actual css files or just <style> tags? It's kind of the
| same idea, you scope down to such a granular level that the
| style literally applies to that one element. It bypasses CSS
| and forces style composition to occur at a programmatic level
| (Component-first thinking).
|
| It's one thing to utilize the convenience of css-in-js as
| needed, but we have, as usual, gone to the extreme and just
| wholesale ditched css lol.
___________________________________________________________________
(page generated 2021-11-17 23:01 UTC)