Skip to content

[docs][templates] Fix rendering of logos in dark mode #46221

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

Merged
merged 3 commits into from
May 28, 2025

Conversation

sai6855
Copy link
Contributor

@sai6855 sai6855 commented May 26, 2025

@sai6855 sai6855 added bug 🐛 Something doesn't work docs Improvements or additions to the documentation labels May 26, 2025
@mui-bot
Copy link

mui-bot commented May 26, 2025

Netlify deploy preview

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

Bundle size report

No bundle size changes (Toolpad)
No bundle size changes

Generated by 🚫 dangerJS against 8f33fe0


const whiteLogos = [
const darkModeLogos = [
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I renamed variable names to show their purpose, not what they actually are.

@sai6855 sai6855 requested a review from DiegoAndai May 27, 2025 04:37
@@ -30,8 +30,19 @@ const logoStyle = {
};

export default function LogoCollection() {
const theme = useTheme();
const logos = theme.palette.mode === 'light' ? darkLogos : whiteLogos;
Copy link
Member

Choose a reason for hiding this comment

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

Why this didn't work?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There are 2 issues with this code

  1. theme.palatte.mode isn't returning updated mode value when user changes theme. useColorScheme is returning correct mode, hence i used that
  2. system mode is not properly handled here.

@sai6855 sai6855 merged commit 223bf73 into mui:master May 28, 2025
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work docs Improvements or additions to the documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix theme implementation on logo collection block on marketing page
3 participants