Skip to content

[colorManipulator] lighten/darken a CSS var() color #43324

@kiddliu

Description

@kiddliu

Summary

Hi, I'm working on my own design system implementation with MUI v6 (base + system). Previously, with utilities in colorManipulator I can easily lighten/darken a color defined in palette. With CSS variables, now it's difficult and I have to augment the palette a lot. For alpha the solution is with pure CSS function rgba, probably for lighten/darken I should go with the same way? Or, by getComputedStyle I can run the same function just as before?

Examples

-      color: darken(theme.palette.primary.main),
+      color: darken(theme.vars.palette.primary.main),

Motivation

No response

Search keywords: colorManipulator lighten darken var CSS color

Metadata

Metadata

Assignees

Labels

customization: themeHigher level theming customizability.scope: systemSpecific to @mui/system.type: new featureExpand the scope of the product to solve a new problem.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions