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

[docs-infra] Support CSS variables API info #44559

Merged
merged 8 commits into from
Nov 27, 2024

Conversation

mnajdova
Copy link
Member

@mnajdova mnajdova commented Nov 26, 2024

Needed for generating CSS variables in the Base UI's API tables, see mui/base-ui#874

The changes in the Joy UI's Accoridon component are just for testing, I will revert those in the end.

@mnajdova mnajdova added the scope: docs-infra Specific to the docs-infra product label Nov 26, 2024
@mui-bot
Copy link

mui-bot commented Nov 26, 2024

Netlify deploy preview

https://deploy-preview-44559--material-ui.netlify.app/

Bundle size report

No bundle size changes (Toolpad)
No bundle size changes

Generated by 🚫 dangerJS against 3cd6bb4

@mnajdova mnajdova marked this pull request as ready for review November 27, 2024 08:44
Copy link
Member

@alexfauquette alexfauquette left a comment

Choose a reason for hiding this comment

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

Looks good.

I don't have solution for now, but we should find a way to let others now that this feature relies on some assumptions:

  • The matching relies on [ComponentName]CssVars
  • The variables names are generated with --${kamelCase(propName)} so you can't create a accordionCssVars without following this convention

@mnajdova
Copy link
Member Author

The matching relies on [ComponentName]CssVars

Agree, this should be communicated (I am handling the first PR on Base UI's side). I followed the convention I started for the hooks here (there we expect HookNameParams & HookNameReturnValue as types to exists)

The variables names are generated with --${kamelCase(propName)} so you can't create a accordionCssVars without following this convention

On Base UI, I created util for generating the CSS variables, similar to the generateUtilityClasses, see https://github.com/mui/base-ui/pull/874/files#diff-8754fb58432b15f7eb3117b38ed67724d2b667f784e70ac32700ee7ad2957479R1. This will avoid doing typos or making the CSS variables names inconsistent

@mnajdova mnajdova merged commit 429fcb9 into mui:master Nov 27, 2024
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: docs-infra Specific to the docs-infra product
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants