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] Use applyDarkStyles for markdown render #41275

Closed

Conversation

alexfauquette
Copy link
Member

@alexfauquette alexfauquette commented Feb 26, 2024

@siriwatknp I'm not sure if that's a correct approach

Fix #41239

@mui-bot
Copy link

mui-bot commented Feb 26, 2024

Netlify deploy preview

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

Bundle size report

No bundle size changes (Toolpad)
No bundle size changes

Generated by 🚫 dangerJS against 98188ce

@alexfauquette alexfauquette marked this pull request as ready for review February 26, 2024 12:21
color: 'rgb(255, 255, 255)',
'& :not(pre) > code': {
// inline code block
color: theme.palette.text.primary,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it use ?

Suggested change
color: theme.palette.text.primary,
color: (theme.vars || theme).palette.text.primary,

@alexfauquette alexfauquette self-assigned this Feb 26, 2024
@alexfauquette alexfauquette added the scope: docs-infra Specific to the docs-infra product label Feb 26, 2024
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Feb 27, 2024
@@ -570,159 +567,157 @@ const Root = styled('div')(
marginBottom: theme.spacing(1),
},
},
}),
({ theme }) => ({
[`:where(${theme.vars ? '[data-mui-color-scheme="dark"]' : '.mode-dark'}) &`]: {
Copy link
Member

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.

Comment on lines -579 to -584
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]})`,
Copy link
Member

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.

siriwatknp

This comment was marked as off-topic.

Copy link
Member

@siriwatknp siriwatknp left a 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: out-of-date The pull request has merge conflicts and can't be merged scope: docs-infra Specific to the docs-infra product
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[docs-infra] The docs with RTL break the dark theme
3 participants