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

Fix Color Contrast for Catppuccin Mocha card background #6896

Open
wants to merge 1 commit into
base: development
Choose a base branch
from

Conversation

artkapl
Copy link

@artkapl artkapl commented Feb 23, 2025

Fix Color Contrast for Catppuccin Mocha card background

Pull Request Type

  • Bugfix
  • Feature Implementation
  • Documentation
  • Other

Related issue

closes #6597

Description

I wanted to improve the color contrast for the background around the video uploader's name on an uploader's comment. Strong color contrasts are important for accessibility.

This PR improves the color contrast from 1.07:1 to 3.59:1 (link to contrast checker) while still staying within the Catppuccin Mocha color palette ("Overlay 0").

I considered this color a decent middleground between background contrast and text contrast. The text vs. secondary-card-bg contrast is still a clearly differentiated 3.37:1.

Screenshots

Before:
old

After:
new

Testing

  • This was tested by changing the CSS code on a local FreeTube instance
  • No ramifications (other themes remain unchanged)

Desktop

  • OS: Windows
  • OS Version: 10
  • FreeTube version: v0.23.1 Beta

Additional context

This satisfies the WCAG recommendation of at least 3:1.

@github-actions github-actions bot added the PR: waiting for review For PRs that are complete, tested, and ready for review label Feb 23, 2025
@FreeTubeBot FreeTubeBot enabled auto-merge (squash) February 23, 2025 09:23
@kommunarr
Copy link
Collaborator

Thanks for looking into this!

I considered this color a decent middleground between background contrast and text contrast. The text vs. secondary-card-bg contrast is still a clearly differentiated 3.37:1.

Unfortunately, this will not suffice because the minimum acceptable color contrast between a text color and its background color is 4.5:1 or 7:1 (depending on whether WCAG AA or AAA standard is being used).

@artkapl
Copy link
Author

artkapl commented Feb 23, 2025

Unfortunately, this will not suffice because the minimum acceptable color contrast between a text color and its background color is 4.5:1 or 7:1 (depending on whether WCAG AA or AAA standard is being used).

I hear you. However, there is a tradeoff between background contrast and text contrast.
If we were to use blue (the Catppuccin recommendation for tags & pills), the card:background contrast is 8.33:1, but the text:card contrast is only 1.45:1.

If we choose a lighter color, the text is less readable. A darker color means the current implementation's problem.

If you have an idea as to which color offers a good contrast both versus the background and the text, I'm open to suggestions. Otherwise I don't see how to get one contrast without sacrificing the other.

Examples:

color hex card:bg card:text example
Overlay 0 #6c7086 3.59:1 3.37:1 overlay0
blue #89b4fa 8.33:1 1.45:1 blue
Overlay 1 #7f849c 4.75:1 2.55:1 overlay1
Surface 0 #313244 1.39:1 8.69:1 surface0

@kommunarr
Copy link
Collaborator

That's unfortunately the case, and we should not sacrifice either if we can help it. One way we could do this is by having separate colors for the border around the name and the inner background text color.

@efb4f5ff-1298-471a-8973-3d47447115dc efb4f5ff-1298-471a-8973-3d47447115dc added PR: changes requested and removed PR: waiting for review For PRs that are complete, tested, and ready for review labels Feb 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: catppuccinMocha: Color contrast for owner comments is too low
3 participants