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

Update body background, body background medium, inline-code, and hover-invert colors on dark theme #742

Closed
wants to merge 2 commits into from

Conversation

homing1
Copy link
Contributor

@homing1 homing1 commented Feb 20, 2025

Link: preview

This PR updates the body-background color on dark theme. Body-background-medium, inline-code, and hover-invert colors are also updated to maintain sufficient color contrast.

Fluent colors: https://react.fluentui.dev/?path=/docs/theme-colors--docs

Testing

  1. Visit http://localhost:1111/atomics/colors.html, switch to dark theme. Review the body and body medium colors. Note that body-background-medium is lighter than body-background, same as before.
  2. Visit http://localhost:1111/components/button.html . Review the default button hover color. It matches Fluent's colorNeutralBackground1Hover color on dark theme, #3d3d3d .
  3. Review the inline code in the table's Class column. I couldn't find any Fluent guidance on inline code colors, so I picked a bright enough color to make the inline code stand out against the new background. The contrast ratio between the background and inline code block background is 2.013, which is an improvement compared to the previous 1.7~.
  4. Visit http://localhost:1111/components/textarea.html . Review the disabled text area background color for the new body background medium color # 333. The former color #2F2F2F only has 1.086:1 contrast ratio with the new body background color. The previous ratio is 1.339:1. The new body background medium color offer 1.151:1 ratio. It matches Fluent's colorNeutralBackground6 color, which is already the lightest grey color for dark theme amongst all 6 colorNeutralBackground colors. To improve the ratio even more, I see two options:
    • Use # 000 black to make body medium darker than body instead of lighter, which increases the ratio to 1.443:1. This would change the current pattern of moving dark to light.
    • Use #3d3d3d which is colorNeutralBackground1Hover, which increases the ratio to 1.339:1

Additional information

[Optional]

Contributor checklist

  • Did you update the description of this pull request with a review link and test steps?
  • Did you submit a changeset? Changesets are required for all code changes.
  • Does your pull request implement complex UI logic (js/ts)? Consider adding an integration test to test your user flow.
  • Does your pull request add a new page to the documentation site? Add your new page for automated accessibility testing in /integration/tests/accessibility.
  • Does your pull request change any transforms? Did you test they work on right to left?

@homing1 homing1 requested a review from a team as a code owner February 20, 2025 02:49
Copy link

changeset-bot bot commented Feb 20, 2025

🦋 Changeset detected

Latest commit: 4e0be80

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@microsoft/atlas-css Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@homing1 homing1 changed the title Update body background, body background medium, inline-code, and hover-invert in dark theme Update body background, body background medium, inline-code, and hover-invert colors on dark theme Feb 20, 2025
@wibjorn
Copy link
Contributor

wibjorn commented Feb 25, 2025

Code is good, and this works well. This does seem quite light for a dark mode. Wonder if we should discuss the possibility of a darker color instead?

@homing1 homing1 closed this Mar 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants