-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
Conversation
There was a problem hiding this 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; |
There was a problem hiding this comment.
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.
Currently, the
Link
component usesalpha
for color manipulation and will throw an errorUnsupported `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/