Material-ui: [Accordion] Summary low contrast on focus in dark mode

Created on 22 Apr 2020  路  4Comments  路  Source: mui-org/material-ui

  • [x] The issue is present in the latest release.
  • [x] I have searched the issues of this repository and believe that this is not a duplicate.

Current Behavior 馃槸

Screen Shot 2020-04-22 at 12 47 20 AM

Expected Behavior 馃

The summary text should be more legible.

Steps to Reproduce 馃暪

Steps:

  1. Go to https://material-ui.com/components/expansion-panels/#expansion-panel
  2. Enable dark mode
  3. Use tab key to navigate to an expansion panel summary element

Context 馃敠

The context is accessibility.

Inputting the values into https://webaim.org/resources/contrastchecker/:

Screen Shot 2020-04-22 at 12 53 03 AM

accessibility bug 馃悰 Accordion good first issue

All 4 comments

Maybe for darken theme is better to use 600: '#757575'; instead of 300: '#e0e0e0';

Wow, it has been broken like this for 2 years 馃檭. How is this even possible. Do people use the accordion or dark mode at all 馃槺?

What about this diff?

diff --git a/packages/material-ui/src/ExpansionPanelSummary/ExpansionPanelSummary.js b/packages/material-ui/src/ExpansionPanelSummary/ExpansionPanelSummary.js
index b61281403..c476e7d30 100644
--- a/packages/material-ui/src/ExpansionPanelSummary/ExpansionPanelSummary.js
+++ b/packages/material-ui/src/ExpansionPanelSummary/ExpansionPanelSummary.js
@@ -25,10 +25,10 @@ export const styles = (theme) => {
         minHeight: 64,
       },
       '&$focused': {
-        backgroundColor: theme.palette.grey[300],
+        backgroundColor: theme.palette.action.focus,
       },
       '&$disabled': {
-        opacity: 0.38,
+        opacity: theme.palette.action.disabledOpacity,
       },
     },
     /* Pseudo-class applied to the root element, children wrapper element and `IconButton` component if `expanded={true}`. */

I have tried and can be good

Am i mistake or I saw a PR for this?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

finaiized picture finaiized  路  3Comments

ghost picture ghost  路  3Comments

activatedgeek picture activatedgeek  路  3Comments

revskill10 picture revskill10  路  3Comments

sys13 picture sys13  路  3Comments