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

Improved colors #13336

Closed
zepfietje opened this issue Jun 20, 2024 · 5 comments
Closed

Improved colors #13336

zepfietje opened this issue Jun 20, 2024 · 5 comments
Assignees
Labels
a11y enhancement New feature or request ui
Milestone

Comments

@zepfietje
Copy link
Member

zepfietje commented Jun 20, 2024

Make sure foreground color is accessible on background color for buttons for example.
Also add support for light and dark buttons.

Donate 💰 to fund this issue

  • You can donate funding to this issue. We receive the money once the issue is completed & confirmed by you.
  • 100% of the funding will be distributed between the Filament core team to run all aspects of the project.
  • Thank you in advance for helping us make maintenance sustainable!
Fund with Polar
@zepfietje zepfietje self-assigned this Jun 20, 2024
@github-project-automation github-project-automation bot moved this to Todo in Roadmap Jun 20, 2024
@zepfietje zepfietje added enhancement New feature or request ui a11y labels Jun 20, 2024
@zepfietje zepfietje added this to the v4 milestone Jun 20, 2024
@mgkimsal
Copy link
Contributor

I'd added a discussion item about this a couple months ago. Might be able to lend a hand if there's something to help review/test or submits PRs for. Glad to fund a bit towards filament improving this too.

@zepfietje
Copy link
Member Author

Thanks, @mgkimsal!
Could you link to that discussion here?

@mgkimsal
Copy link
Contributor

mgkimsal commented Jul 8, 2024

@zepfietje - sorry for delay!

#12548

It was just an initial ask for "is this interesting to anyone?" I was a bit reluctant to put in work in to this if it wasn't something anyone thought would be useful. AT THAT TIME, I had more time on my hands. :). I don't today, but am definitely open to helping if there's something I may be able to lend a hand with.

My initial thoughts were to just come up with some tweaks to a few of the color palettes to help get them to validate against the WCAG(?) contrast standards. But I was also reading in the github project that there's a potentially bigger overhaul of styling coming in a future version, so unsure how colors may impact any of that work.

And... as you can see, it's not a 'discussion' as much as a starting question :)

@danharrin
Copy link
Member

In Filament 3, colored components like buttons had fixed shades. For example, the background color of a button would be 600 (green, red, blue) on light mode and 500 in dark mode. Some 600 shades are accessible and some are not.

#15474 introduces scripts that analyse the color palette used and dynamically pick the shade of color based on its contrast ratio. All textual elements should now have 4.5 ratio with their background (WCAG AA standard) and non-textual elements have a 3 ratio also (WCAG standard). Hover states of elements also tweak the text color to ensure it remains accessible.

Colors are defined in OKLCH in Filament 4, so the work involved converting that format to RGB before calculating the ratio.

UI components now have their own classes that determine how shades are picked for that component. It replaces the old shade configuration system from Filament 3. These classes can be overriden by the user (used when the theme is heavily customized).

@github-project-automation github-project-automation bot moved this from Todo to Done in Roadmap Jan 30, 2025
@mgkimsal
Copy link
Contributor

Sounds great! Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a11y enhancement New feature or request ui
Projects
Status: Done
Development

No branches or pull requests

3 participants