Skip to content

[docs] Add blog post for enhanceHighContrast#48753

Open
silviuaavram wants to merge 6 commits into
mui:masterfrom
silviuaavram:blog/enhance-whcm
Open

[docs] Add blog post for enhanceHighContrast#48753
silviuaavram wants to merge 6 commits into
mui:masterfrom
silviuaavram:blog/enhance-whcm

Conversation

@silviuaavram

@silviuaavram silviuaavram commented Jul 2, 2026

Copy link
Copy Markdown
Member
  • I have followed (at least) the PR section of the contributing guide.

  • Add blog post documenting the creation of enhanceHighContrast

  • Add a demo to show the fixed components and their states.

@silviuaavram silviuaavram added docs Improvements or additions to the documentation. accessibility a11y blog Related to blog content or publication. labels Jul 2, 2026
@code-infra-dashboard

code-infra-dashboard Bot commented Jul 2, 2026

Copy link
Copy Markdown

Deploy preview

Bundle size

Bundle Parsed size Gzip size
@mui/material 0B(0.00%) 0B(0.00%)
@mui/lab 0B(0.00%) 0B(0.00%)
@mui/private-theming 0B(0.00%) 0B(0.00%)
@mui/system 0B(0.00%) 0B(0.00%)
@mui/utils 0B(0.00%) 0B(0.00%)

Details of bundle changes


Check out the code infra dashboard for more information about this PR.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds new documentation content around Windows High Contrast / forced-colors support in Material UI by publishing a blog post and introducing a showcase demo that compares component states with and without the enhanceHighContrast theme enhancer. It also updates docs infrastructure to recognize the new author and tag.

Changes:

  • Add a new blog post page for “Windows High Contrast mode support in Material UI”.
  • Add a HighContrastShowcase demo and reference it from the palette customization docs and blog post.
  • Extend blog metadata support (author registry and whitelisted tags) for the new post.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
docs/src/modules/components/TopLayoutBlog.js Registers the new blog author so the post can render author metadata.
docs/pages/blog/designing-for-forced-colors-in-material-ui.md Adds the blog post content, including a demo embed for the new showcase.
docs/pages/blog/designing-for-forced-colors-in-material-ui.js Adds the Next.js page wrapper to render the markdown blog post with TopLayoutBlog.
docs/lib/sourcing.ts Whitelists Accessibility as an allowed blog tag (used by the new post).
docs/data/material/customization/palette/palette.md Links the new showcase demo from the “Windows High Contrast mode” section.
docs/data/material/customization/palette/HighContrastShowcase.tsx Adds the TypeScript version of the showcase demo.
docs/data/material/customization/palette/HighContrastShowcase.js Adds the JavaScript version of the showcase demo.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread docs/pages/blog/designing-for-forced-colors-in-material-ui.md Outdated
Comment thread docs/pages/blog/designing-for-forced-colors-in-material-ui.md Outdated
Comment thread docs/pages/blog/designing-for-forced-colors-in-material-ui.md Outdated
Comment thread docs/pages/blog/designing-for-forced-colors-in-material-ui.md Outdated
Comment thread docs/pages/blog/designing-for-forced-colors-in-material-ui.md Outdated
Comment thread docs/data/material/customization/palette/HighContrastShowcase.js Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.

Comment on lines +28 to +31
CSS provides a media query that detects whenever forced colors are active:

### @media (forced-colors: $value)


Here, we're using a pair of system colors to style a menu item's selected state. Native HTML elements get a lot of this behavior from the browser for free. Custom-built components do not always have that same semantic mapping, so component libraries need to fill the gap.

### forced-color-adjust: $value
Comment thread docs/data/material/customization/palette/HighContrastShowcase.tsx
Comment thread docs/data/material/customization/palette/HighContrastShowcase.tsx

@siriwatknp siriwatknp left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The demo layout could be improved:

  • add more space for the toggle
Image
  • may be showing tooltip placement as top or bottom
Image


Browsers force a defined set of color-related properties at paint time. That detail matters: the CSS cascade can still contain author colors, but the browser paints a forced system color instead. System color keywords give authors a way to make the rest of the component fit that same palette.

## CSS Features

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think this part is a bit confusing. As I read, I am not sure which is included in Material UI.
I suggest to start with something like "Material UI adopt/uses … " and then if you want to explain it more, it's okay for a few sentences.


This is a sharp tool. When `forced-color-adjust: none` is used, the browser stops protecting that element's colors, so the author becomes responsible for the contrast of the element and its children. In Material UI, that made sense for selected and active states where we wanted to pair colors like `SelectedItem` with `SelectedItemText` or `Highlight` with `HighlightText`.

## Chrome DevTools Emulation

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I would remove this as a H2 and move to the hint above or below demo instead so user know how to emulate properly.

Adding it here has no connection in the blog at all.

@@ -0,0 +1,248 @@
---
title: Windows High Contrast mode support in Material UI

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

After reading, I feel like the title should be around "A quest to support Windows High Contrast mode for Material UI".

Because you started with intro and then problem and then explain approached taken until a final solution.

tags: ['Material UI', 'Accessibility', 'Guide']
manualCard: false
---

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I suggest a "TLDR;" to summarize everything at the top.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

accessibility a11y blog Related to blog content or publication. docs Improvements or additions to the documentation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants