-
-
Notifications
You must be signed in to change notification settings - Fork 32.8k
Closed
Labels
breaking changeIntroduces changes that are not backward compatible.Introduces changes that are not backward compatible.priority: importantThis change can make a difference.This change can make a difference.scope: systemThe system, the design tokens / styling foundations used across components. eg. @mui/system with MUIThe system, the design tokens / styling foundations used across components. eg. @mui/system with MUItype: new featureExpand the scope of the product to solve a new problem.Expand the scope of the product to solve a new problem.
Description
Supporting CSS variables would:
- Support CSS variables as theme option #12827 (comment): open up avoiding flickering of dark mode websites implemented in frameworks like Next.js or Gatsby! (This seems to be the case on the https://material-ui.com/ website itself! Eg. if you set dark mode and refresh, the page will briefly show up in light mode, and then change to dark mode, causing a flicker)
Problem demonstrated: https://joshwcomeau.com/css/css-variables-for-react-devs/#dark-mode-flash-fix
Solution with CSS variables: https://joshwcomeau.com/gatsby/dark-mode/ - [styles] Memoize makeStyle result to avoid rerendering #25018: make the switch between dark and light feel more instant. Relying on CSS cascading will always be faster than React context cascading.
Benchmark
oliviertassinari, sanohin, a-x-, lassemon, Discartyptics and 48 moremustafaabobakr, Tiberriver256 and RobertArona-x-, goto-bus-stop, ianstormtaylor, felipenmoura, Lure5134 and 10 moremustafaabobakr, rescribet, Tiberriver256, jesusvallez and RobertAronmustafaabobakr, aderchox and pharmpy-dev-123
Metadata
Metadata
Assignees
Labels
breaking changeIntroduces changes that are not backward compatible.Introduces changes that are not backward compatible.priority: importantThis change can make a difference.This change can make a difference.scope: systemThe system, the design tokens / styling foundations used across components. eg. @mui/system with MUIThe system, the design tokens / styling foundations used across components. eg. @mui/system with MUItype: new featureExpand the scope of the product to solve a new problem.Expand the scope of the product to solve a new problem.