Hacker News new | ask | show | jobs
by aphexairlines 1313 days ago
There's still no good way of publishing an npm package with multiple components, stylesheets per component, and transitive consumers using only the stylesheets for the components they reference while rendering fully server side. CSS is still not scalable.
1 comments

This is what native CSS module scripts solve.

You can import CSS directly into JavaScript modules:

    import styles from './styles.css' assert {type: 'css'};

https://web.dev/css-module-scripts/

Live example: https://lit.dev/playground/#gist=f0bdd3b5db5e4a404297e695305...

SSR was mentioned though.