-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
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 inject dynamic theme #42879
Conversation
Netlify deploy previewhttps://deploy-preview-42879--material-ui.netlify.app/ Bundle size report |
I aim to have the documentation site expose a function in the window, such as |
Replied here: #41391 (comment) |
For which part of your code needs to get access to react? When looking at the code sample you provide, I see no reference to it. For material, I see classeNames, which I assume could be replaced by their values, and types which will disappear when transformed to a js code. Do you already have an implementation of the extension to see how it would work, and to test if it behaves as expected |
@alexfauquette Yes, I have implemented this Chrome extension. After switching the toggle in the extension, will apply our custom theme to the doc site. Here are some examples I can provide. After consideration, we can not depend on MUI, we can compile to js code just like you said. But we still need react & react-jsx, because we override some components' default icons, it is ReactNode type, and after compile will need jsx to do the creation. As for the React, we have some custom compennts, need use some hooks API from React, like |
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.
Good for me @siriwatknp do you have an opinion about it?
@Vxee Can you provide the extension for us to test it or may be a recording? |
Signed-off-by: Siriwat K <siriwatkunaporn@gmail.com>
Signed-off-by: Siriwat K <siriwatkunaporn@gmail.com>
@Vxee I changed the property to |
…ui into docs-dynamic-theme-inject
…ynamic-theme-inject
@siriwatknp Thanks a lot! Here is the demo. MUI_extension_demo_2024-08-01_17.03.01.mp4When will this function be available in MUI doc? |
Closes #41391