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] Change CSS vars generation to be extracted from Enum #44587

Merged
merged 12 commits into from
Dec 3, 2024

Conversation

mnajdova
Copy link
Member

@mnajdova mnajdova commented Nov 28, 2024

This PR updates the CSS vars docs generation, to depend on an enum, as it offers better representation in comparison with interface + const. The enum could have the following form:

enum AccordionCssVars {
  /**
   * The max width of the Accordion.
   * @type {number}
   */
  maxWidth = '--max-width',
  foo = '--foo',
}

As we may not want to expose this enums as a public API, the script is updated to look for specific files in order to find the enum. The usage can be find in mui/base-ui#874.

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

mui-bot commented Nov 28, 2024

Netlify deploy preview

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

Bundle size report

No bundle size changes (Toolpad)
No bundle size changes

Generated by 🚫 dangerJS against 8e1e12a

@mnajdova mnajdova changed the title [infra] Change CSS vars generation to be extracted from Enum [docs-infra] Change CSS vars generation to be extracted from Enum Nov 28, 2024
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Dec 2, 2024
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Dec 2, 2024
@mnajdova mnajdova marked this pull request as ready for review December 2, 2024 12:25
@mnajdova
Copy link
Member Author

mnajdova commented Dec 2, 2024

@alexfauquette we decided to change a bit the processing of the CSSVars type:

  • use enum, it better fits the purpose, no need for a const
  • we didn't want to include this in the public API, so we are looking into a specific file name convention (CssVars|Classes) ending

I added example to showcase the change.

@mnajdova mnajdova merged commit ea60388 into mui:master Dec 3, 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.

4 participants