3 ms·
I second the author’s recommendation for CSS modules. However > And because the styling code lives outside your TypeScript files, you don't get type safety and
by katspaugh 3y ago
I second the author’s recommendation for CSS modules. However
> And because the styling code lives outside your TypeScript files, you don't get type safety and autocompletion.
You actually do, there’s a TypeScript plugin from CSS modules that generates types for your CSS classes (at least).
- tipiirai 3y agoWhy would I need type safety for my CSS?
- hamandcheese 3y agoGood editor support/autocomplete, probably.
- katspaugh 3y agoThat's not for CSS itself, that's when you import your CSS as a module into your TypeScript/JavaScript module. It will then know which CSS classes are available from your CSS file.
- tipiirai 3y ago> that generates types for your CSS classes This sentence caught my eye
- leerob 3y agoOh nice, I didn't know this.