Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Link] Add support for CSS variables #33036

Merged
merged 10 commits into from Jun 9, 2022
Merged

Conversation

winderica
Copy link
Contributor

@winderica winderica commented Jun 5, 2022

Currently, the Link component uses alpha for color manipulation and will throw an error Unsupported `var(--md-palette-primary-main)` color when the experimental CSS Variable API is enabled, but it is not listed in #32049.

This PR follows the patterns described in #32049 in order to support CSS variables and fixes this issue.

Preview: https://deploy-preview-33036--material-ui.netlify.app/experiments/material-ui/link/

@mui-bot
Copy link

mui-bot commented Jun 5, 2022

Details of bundle changes

Generated by 🚫 dangerJS against 6fded2b

@siriwatknp siriwatknp self-assigned this Jun 7, 2022
@siriwatknp siriwatknp added new feature New feature or request package: material-ui Specific to @mui/material labels Jun 7, 2022
@siriwatknp siriwatknp requested a review from mnajdova June 7, 2022 11:24
Copy link
Member

@siriwatknp siriwatknp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Thanks for kicking off the PR. I have updated the logic in a new file with test cases.

cc @mnajdova for final review.

@@ -13,3 +13,4 @@ export interface StyleOptions<PropKey> {
export function style<PropKey extends string, Theme extends object>(
options: StyleOptions<PropKey>,
): StyleFunction<{ [K in PropKey]?: unknown } & { theme?: Theme }> & { filterProps: string[] };
export function getPath<T>(obj: T, path: string | undefined, checkVars?: boolean): null | unknown;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I tried to import the function in typescript, it could not find the typings so I added it here.

@siriwatknp siriwatknp merged commit b5bbbec into mui:master Jun 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature New feature or request package: material-ui Specific to @mui/material
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants