-
-
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-infra] Use applyDarkStyles
for markdown render
#41275
[docs-infra] Use applyDarkStyles
for markdown render
#41275
Conversation
Netlify deploy previewhttps://deploy-preview-41275--material-ui.netlify.app/ Bundle size report |
color: 'rgb(255, 255, 255)', | ||
'& :not(pre) > code': { | ||
// inline code block | ||
color: theme.palette.text.primary, |
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.
Should it use ?
color: theme.palette.text.primary, | |
color: (theme.vars || theme).palette.text.primary, |
@@ -570,159 +567,157 @@ const Root = styled('div')( | |||
marginBottom: theme.spacing(1), | |||
}, | |||
}, | |||
}), | |||
({ theme }) => ({ | |||
[`:where(${theme.vars ? '[data-mui-color-scheme="dark"]' : '.mode-dark'}) &`]: { |
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.
I think there's a reason I did not use theme.applyDarkStyles
and go with plain string here so that it's context independent. The MarkdownElement has to use the branding theme tokens to be consistent but in some demos the branding theme is overridden by the default theme.
color: `var(--muidocs-palette-text-primary, ${darkTheme.palette.text.primary})`, | ||
borderColor: alpha(darkTheme.palette.primaryDark[600], 0.6), | ||
backgroundColor: `var(--muidocs-palette-grey-900, ${darkTheme.palette.grey[900]})`, | ||
}, | ||
'& strong': { | ||
color: `var(--muidocs-palette-grey-200, ${darkTheme.palette.grey[200]})`, |
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.
This's why I hand-picked the variables to make the component context independent.
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.
The correct changes would be using globalSelector in https://github.com/mui/material-ui/blob/master/docs/src/modules/utils/StyledEngineProvider.js so I think it's better to create a new PR.
@siriwatknp I'm not sure if that's a correct approach
Fix #41239