-
-
Notifications
You must be signed in to change notification settings - Fork 32.8k
Closed
Labels
customization: cssDesign CSS customizability.Design CSS customizability.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 MUI
Description
Steps to reproduce
StackBlitz repro: https://stackblitz.com/edit/react-ue9j7k-o6j3ve?file=Demo.js (inspect the Checkbox)
Current behavior
The theme file can receive colors in many formats, including hsl() and hsla(), and the System's alpha() function should be able to modify the alpha channel for all of them. That doesn't seem to be the case with hsl() at the moment. If my color shade is defined like this in the theme:
const blue = {
main: 'hsl(210 20 10)',
};And I use the alpha() function like so:
bgcolor: alpha(theme.palette.primary.main, 0.2)I see this on the dev tools:
background-color: hsla(210, undefined%, undefined%, 0.2)Expected behavior
I would expect the alpha() function to work the same as it does with HEX color values or even color(display-p3).
Context
I want to define all of the branding theme colors in HSL, a much easier to read/manipulate color notation, instead of HEX codes.
Search keywords: color manipulator, alpha function, hsl
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
customization: cssDesign CSS customizability.Design CSS customizability.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 MUI