readium / playground

🛝 Play with the capabilities of Readium Web & Readium CSS
https://playground.readium.org
BSD 3-Clause "New" or "Revised" License
2 stars 0 forks source link

Color contrast in immersive mode #26

Open JayPanoz opened 1 day ago

JayPanoz commented 1 day ago

Right now our primary color is #4d4d4d. To have a contrast that passes WCAG AA, it needs to be at least 77% opacity, which makes the difference between normal and immersive modes kinda difficult to notice.

HadrienGardeur commented 1 day ago

I guess that the implementation of themes could also affect this value. Is there any way to dynamically calculate this contrast ratio as well?

JayPanoz commented 1 day ago

I know they have had issues specc’ing this in CSS as it’s a pretty popular issue but that means lots of options exist in JS/TS-land. Even React actually – with an explainer in the ReadMe.

I guess the main challenge may be building upon the known solutions to find the nearest match with good enough contrast in a dynamic manner, and reliably. But in theory it should be feasible.