-
-
Notifications
You must be signed in to change notification settings - Fork 49
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
[infra] Automatically get info for CSS variables #874
Conversation
Netlify deploy preview |
Signed-off-by: Marija Najdova <[email protected]>
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.
👼
@@ -20,11 +20,5 @@ | |||
"type": "number", | |||
"description": "Indicates how many dialogs are nested within." | |||
} | |||
}, | |||
"cssVariables": { |
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.
No need for manually defining it 🎉
@@ -0,0 +1,11 @@ | |||
export type DialogPopupCssVars = { |
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.
The convention here is tha the type with [ComponentName]CssVars
exists. By default, the type is assumed string, if it is something else we can add the @type tag. The actual CSS variable in the docs is the kebab case of the key. I added support for the @deprecated tag too, in case we ever need it in the future.
nestedDialogs: string; | ||
}; | ||
|
||
export const cssVars: DialogPopupCssVars = generateCssVariables(['nestedDialogs']); |
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.
I added this util similar to the utility for generating classes we have in other projects: https://github.com/mui/material-ui/blob/master/packages/mui-material/src/Dialog/dialogClasses.ts#L43, to make sure we don't have typos while generating the CSS variables.
Signed-off-by: Marija Najdova <[email protected]>
Signed-off-by: Marija Najdova <[email protected]>
This PR proposes a more structured way of defining CSS variables used in the components. The benefits are:
Depends on mui/material-ui#44587
Preview: https://deploy-preview-874--base-ui.netlify.app/new/components/dialog#popup
I will update the rest of the CSS variables usages in a follow up PR.