• Sharing Constants (between JS and CSS) • eg. Class names to toggle on click • Non-deterministic Resolution • Order or requires/@imports matter • Isolation • Automated refactoring tools • New Syntax/Language
where styles are coming from • Avoid selector clashes • Special cases are easy to implement • Portability of our components • Consistent Styling Possible (DRY Styles) • sharing variables/constants • fast unit tests for our styling • minimal dependencies
designers/developers are used to it • autoprefixer can be integrated • Browser developer tools can be used Disadvantages • new language as a dependency • global css declarations • portability is hard • dead code elimination is hard • automated refactoring tools are missing
JS refactoring tools can be used • dead code can be detected • styles can be calculated during runtime • e.g. custom color scheme for ever customer, without generating a new stylesheet on the server Disadvantages • No Media Queries • No Pseudo Classes (:hover, :active, …) • Styles are calculated during runtime • no dedicated caching of css files
IDE refactoring tools can be used • dead code can be detected • styles calculation during runtime is possible but not required • autoprefixer can be integrated • cache and gzip files