[colorManipulator] Replace colorManipulator with CSS Relative Color Syntax (RCS) #43180
Labels
customization: css
Design CSS customizability
enhancement
This is not a bug, nor a new feature
package: system
Specific to @mui/system
performance
Summary
The codebase rely on logic like
material-ui/packages/mui-system/src/colorManipulator/colorManipulator.js
Line 240 in 85a3b55
which comes with bundle size. However, CSS Relative Color Syntax (RCS) https://lea.verou.me/specs/#relative-colors-rcs is coming. We will be able to rely on it. This should save bundle size and improve the customization experience as it will be clearer in the Browser devtool inspector tool where the color is coming from.
Examples
On the colorspace we want to use, oklch looks like a solid option: https://www.smashingmagazine.com/2023/08/oklch-color-spaces-gamuts-css/. It has a limit though: w3c/csswg-drafts#9449, to be careful.
To see how this fit with
color-mix(
.If this is successful, we could also look doing the same for the color contrast utils. Actually, we might even need to consider both problems at the same time. https://lea.verou.me/blog/2024/contrast-color/ is a great dive into the topic. A must read (e.g. APAC vs. legal requirement).
Motivation
Is likely part of solving #40104, and #37901.
Search keywords: -
The text was updated successfully, but these errors were encountered: