cal.diy icon indicating copy to clipboard operation
cal.diy copied to clipboard

Custom Light/dark mode Restriction for a few cases

Open YOKESHCR opened this issue 3 years ago • 5 comments

When the dark theme/light theme color doesn't pass the contrast check, the update functionality might be restricted. It might be good for a few cases like in the below example.

image image

But for a majority of the cases in the dark mode it looks quite odd like the one in the below example when the buttons or links are hovered. image image.

This is also the same for light mode contrast check. It would be better if the Update functionality is restricted for such scenarios

YOKESHCR avatar May 06 '23 15:05 YOKESHCR

Hey - we dont stop you from setting a colour that doesnt past a contrast check incase this is your brand colour and want to use it.

I dont believe we should force the user to have a brand colour that passes this. Doesnt make too much sense - if you ignore the error you will likely end up with links/hovers looking a bit off.

sean-brydon avatar May 06 '23 16:05 sean-brydon

Hey! I want to take up this issue. Can I?

Vishrut19 avatar May 06 '23 19:05 Vishrut19

Hi @sean-brydon,

Sorry for the late response. I can understand what you are actually trying to explain but if these cases are allowed then the purpose of Light/Dark mode will be nullified.

Is there any other way that this can be solved other than just ignoring those error messages when trying to update them.

Thanks, Yokesh.

YOKESHCR avatar May 13 '23 20:05 YOKESHCR

just ignore the warning. its not an error

PeerRich avatar May 14 '23 22:05 PeerRich

I understand it's only a warning but the whole math logic seams is wrong.

I'm my case I use: Indigo-900 (#312e81) which has a contrast ratio of roughly 11.4:1 against white, which way beyond the contrast ratio criteria (AAA's 7:1) suggested by W3C.

The math genuinely isn't the problem anymore. This points to a bug in Cal.com's contrast checker, not your color choice. There's a documented Cal.com GitHub issue about the contrast check misbehaving and restricting updates in cases where it shouldn't.

JOduMonT avatar Aug 04 '26 21:08 JOduMonT