logoalt Hacker News

stephbooktoday at 1:57 PM1 replyview on HN

I'm lucky to have learned the web with Angular 2.x

It scopes CSS to components by default, and keeps HTML, CSS and JavaScript seperate.


Replies

CharlieDigitaltoday at 2:33 PM

Vue single-file components (SFC[0]) still works this way.

    <template>
    <!-- Largely just HTML -->
    </template>

    <script setup lang="ts">
    // JS/TS as you would expect
    </script>

    <style scoped>
    /* Component scoped styles here */
    </style>
Very clean, easy to understand, and (as someone who started hand writing DHTML) it still feels very much like DHTML with more convenience and modern affordances.

[0] Vue SFC docs: https://vuejs.org/guide/scaling-up/sfc.html