-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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] Add live demo with CssVarsProvider #38792
Merged
oliviertassinari
merged 3 commits into
mui:master
from
oliviertassinari:demo-css-variables
Sep 18, 2023
Merged
[docs] Add live demo with CssVarsProvider #38792
oliviertassinari
merged 3 commits into
mui:master
from
oliviertassinari:demo-css-variables
Sep 18, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
oliviertassinari
added
docs
Improvements or additions to the documentation
package: material-ui
Specific to @mui/material
labels
Sep 3, 2023
oliviertassinari
force-pushed
the
demo-css-variables
branch
from
September 3, 2023 23:30
4d81e69
to
c2d3ea9
Compare
danilo-leal
reviewed
Sep 4, 2023
docs/data/material/experimental-api/css-theme-variables/usage/usage.md
Outdated
Show resolved
Hide resolved
oliviertassinari
commented
Sep 4, 2023
@@ -210,7 +210,6 @@ See the complete usage of `createVssVarsProvider` in [Material UI](https://githu | |||
- `defaultMode?: 'light' | 'dark' | 'system'` - Application's default mode (`light` by default) | |||
- `disableTransitionOnChange : boolean` - Disable CSS transitions when switching between modes | |||
- `enableColorScheme: boolean` - Indicate to the browser which color scheme is used (light or dark) for rendering built-in UI | |||
- `prefix: string` - CSS variable prefix |
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.
Doesn't exist, outdated docs.
github-actions
bot
added
the
PR: out-of-date
The pull request has merge conflicts and can't be merged
label
Sep 6, 2023
oliviertassinari
force-pushed
the
demo-css-variables
branch
from
September 10, 2023 12:16
e50d63f
to
b0cdbcb
Compare
github-actions
bot
added
PR: out-of-date
The pull request has merge conflicts and can't be merged
and removed
PR: out-of-date
The pull request has merge conflicts and can't be merged
labels
Sep 10, 2023
Co-authored-by: Danilo Leal <[email protected]> Signed-off-by: Olivier Tassinari <[email protected]>
oliviertassinari
force-pushed
the
demo-css-variables
branch
from
September 18, 2023 20:10
b0cdbcb
to
7180b23
Compare
github-actions
bot
removed
the
PR: out-of-date
The pull request has merge conflicts and can't be merged
label
Sep 18, 2023
christophermorin
pushed a commit
to christophermorin/material-ui
that referenced
this pull request
Sep 21, 2023
Signed-off-by: Olivier Tassinari <[email protected]> Co-authored-by: Danilo Leal <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I never understood why we didn't have a live demo with CssVarsProvider for Material UI. I have struggled to make this one, I struggled on a couple of points (e.g. tried to use createTheme, tried to use
prefix
, I didn't know where to import extendTheme from).Use case: mui/mui-x#10214
Preview: https://deploy-preview-38792--material-ui.netlify.app/material-ui/experimental-api/css-theme-variables/usage/#getting-started
Regarding the CSS size, the CSS variables added to the HTML docs adds 4 kB gzipped. It doesn't seem to really impact performance: https://www.webpagetest.org/video/compare.php?tests=230903_BiDcR6_A0Z,230903_AiDcV1_A8W.
The dark/light mode switch is broken, but it's beyond this PR. We need to fix this as well to fully migrate our docs to use CSS vars #39047.
Screen.Recording.2023-09-18.at.22.23.44.mov