« BackInline Scope for CSSpicostitch.comSubmitted by wolframkriesing 2 days ago
  • dmix 22 minutes ago

    Oh this could be useful. I've been thinking a lot about this recently.

    I built some older features in Vue with <style> tags in components (SFC, single-file components) and we used Vite to do builds, which extracts all the CSS from individual .vue files into .css files for production deployment. But we also had serverside CSS that didn't need that fancy stuff. So I've been wanting to move to a much simpler CSS system. Just letting esbuild do typescript/Vue and let CSS be CSS. But one of the only drawbacks was losing the automatic CSS scoping, not having to write wrapper .classes/BEM inside components was nice.

    So this would certainly help migrate away from JS dependencies + spaghetti BEM CSS.

    And even more meta I think the general trend in the frontend world is moving away from pure JS-driven frontends back to defaulting to server powered views, with JS tooling only used where it's absolutely needed (high interactivity) without the whole frontend being isolated in a separate build system. So backend devs don't need to worry about JS build pipelines for simple HTML stuff... which they should be trusted to do.

    • Izkata an hour ago
    • omeid2 10 minutes ago

      At some point, we really have to kill CSS.

      • mikae1 16 minutes ago

        > See caniuse for the support, at the time of writing caniuse says 82% support globally. Sounds quite good.

        That's one way of making it sound good. Saying: “it won't work on Firefox” makes it sound worse. But perhaps OP wasn't implying it's production ready.