‹ BackHN Continuity

Thread

Improving site performance by shipping more CSS

96 points · 72 comments · torutofu

  1. lloydatkinson · · focus · HN ↗
    Any time I see criticism of CSS in JS, and a move to CSS modules, I get sad they didn’t just do a bit more research. You can have both, while also not shipping any JS runtime for CSS in JS! And with TypeScript support.

    <a href="https:&#x2F;&#x2F;vanilla-extract.style&#x2F;" rel="nofollow">https:&#x2F;&#x2F;vanilla-extract.style&#x2F;

    1. nicce · · focus · HN ↗
      I thought that whole point of CSS in JS was about building the CSS with JS in build time, to get managed and optimized output, who madman runs in in runtime?
      1. c-hendricks · · focus · HN ↗
        The idea of an `sx` prop kind of implies runtime. If there&#x27;s any logic in those objects it can&#x27;t be pre computed
      2. lloydatkinson · · focus · HN ↗
        It seems all the people criticising CSS in JS are doing it at runtime, like styled-component users.
Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.