-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
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] Provide a hook or function we can dynamic inject our custom theme options using Google Chrome extension #41391
Comments
You can utilize |
👋 Thanks for using our open-source projects! We use GitHub issues exclusively as a bug and feature requests tracker, however, For support with Material UI please check out https://mui.com/material-ui/getting-started/support/. Thanks! If you have a question on Stack Overflow, you are welcome to link to it here, it might help others. |
NO, I mean we want to use chrome extension to inject my custom theme config to MUI official doc site, so the doc site style will change after enable this chrome extension. I hope you can provide a way we can do this. @ZeeshanTamboli |
@Vxee Personally, I don't think I'll be able to dedicate time to this. There's a similar feature for allowing users to inject their preferences in the documentation, but it's only for custom colors - https://mui.com/material-ui/customization/color/#playground. I'll reopen this issue and label it as a feature. Feel free to explore the documentation code and work on it. If you're up for it, you can create a pull request. |
Thanks for your response, I will try to create a PR if it is possible. |
#42879 I have created a PR, please help to review it, thanks. @ZeeshanTamboli |
Thanks for the proposal @Vxee We should check this with the docs infra team before proceeding. @mui/docs-infra, what do you think about this feature? |
Thanks for your response. Do you know who we can talk to in the docs infra team? @DiegoAndai |
For the feature: what additional benefit does changing the entire theme add over changing the theme of just the demo? I imagine adding a toggle which allows switching themes on demos might work similarly. We could work on that as part of Docs Infra; supporting an I'll wait for the rest of Docs Infra to chime in. |
Thanks for your information. Our team heavily utilizes the MUI, we have customized over 90% of the MUI component styles based on our design system. While we still want to see the API usage on the MUI documentation site, we would like the demo styles to reflect our custom styles. Therefore, we hope the documentation site can support It would be fine if you could allow us to add this function in docs infra. |
The demo with the custom theme feature makes sense. But the proposed solution seems like a workaround. So we should be sure it does not impact the majority of our other users. My main concern with the proposed approach is about the |
You are right! I can modify my current implementation, I will do a dynamic import for the The purpose I want to expose MUI to global is in the custom theme, it will use |
@DiegoAndai @alexfauquette I have changed my implementation. It will not impact the majority of users. Please help to review it. We need this feature, thanks. |
This issue was mislabeled, it's not "docs", it's "docs-infra". |
Related page
https://mui.com/material-ui/react-button/
Kind of issue
Other
Issue description
I created a couple of theme configurations that follow the official customize components style guidelines. These configurations are designed to enhance the visual consistency of components. I intend to develop a Chrome extension that incorporates these theme options. When activated, this extension will apply my custom theme, overriding the default Material-UI theme, particularly when browsing Material-UI documentation pages. This will allow users to immediately experience the updated style upon enabling the extension. Additionally, by sharing my theme configuration on GitHub, I hope to assist a wider audience. However, upon inspecting the MUI doc site's source code, I haven't found a direct method to dynamically inject my theme configuration. Given that the configuration is an object, one potential approach is to compile it before performing the injection.
![image](https://private-user-images.githubusercontent.com/14934370/310779053-c6da8085-b4e7-4fea-9d5b-b05e569f77c6.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkzNjgzODQsIm5iZiI6MTczOTM2ODA4NCwicGF0aCI6Ii8xNDkzNDM3MC8zMTA3NzkwNTMtYzZkYTgwODUtYjRlNy00ZmVhLTlkNWItYjA1ZTU2OWY3N2M2LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEyVDEzNDgwNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTAwOWRhNjI0ZmE4NGY4MWI0NmVhNWFiZjljMjUxMzA0ZTMyZTJkYmVmNmE2YWU2OTg4NDRjNDlmYjFlOTQ3NTUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.SSNb9h8-yM7J3HXMa-l85Bt6QcJIJUI0EAD4OjiWhj0)
![image](https://private-user-images.githubusercontent.com/14934370/310779208-a80844ad-dc63-4e75-bc46-17bb4e890574.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkzNjgzODQsIm5iZiI6MTczOTM2ODA4NCwicGF0aCI6Ii8xNDkzNDM3MC8zMTA3NzkyMDgtYTgwODQ0YWQtZGM2My00ZTc1LWJjNDYtMTdiYjRlODkwNTc0LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEyVDEzNDgwNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTQ4ZGE0NGNjNjNlZTJmMGI5MjhlZjZmMWY4NmVlOGI5N2RmYmZmOTIzNjE5ZGE1MTk0MjQxNTA0ZmViZDExZmImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.vS8-xlL57N8Qe0QFrE5sI5gxZTw_x_vE9SRGZjiEhC4)
Context
No response
Search keywords: chrome extension, dynamic inject theme
The text was updated successfully, but these errors were encountered: