It's Just JavaScript
Since immutable styles is just JavaScript it gets the niceties of CSS pre-processors for free. Leveraging everyday JavaScript enables variables, detached rulesets, pre-processor mixins, and theming with little to no extra cost.
Variables
Detached Rulesets
Pre-processor Mixins
You can create your own:
Or use a library such as polished-styles:
Not to be confused with immutable mixins.
Themes
Server-side
Compiling immutable styles server-side – and of course infrastructure permitting – would enable futher functionality, such as generating CSS specific to:
⚗️ Experiments (AB testing)
🎌 Locale
📱 Platform
Note on SupportWhilst this is technically possible now an official server-side compiler hasn't been released. Official support for server-side compilation could be added in future releases.
Last updated