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

Offline warning message is hard to read in dark mode #40193

Closed
huyenltnguyen opened this issue Nov 8, 2020 · 5 comments · Fixed by #40237 · May be fixed by redshark25/freeCodeCamp#1
Closed

Offline warning message is hard to read in dark mode #40193

huyenltnguyen opened this issue Nov 8, 2020 · 5 comments · Fixed by #40237 · May be fixed by redshark25/freeCodeCamp#1
Labels
first timers only Open for anyone doing contributions for first time. You do not need permission to work on these. platform: learn UI side of the client application that needs familiarity with React, Gatsby etc. type: bug Issues that need priority attention. Platform, Curriculum tests (if broken completely), etc.

Comments

@huyenltnguyen
Copy link
Member

huyenltnguyen commented Nov 8, 2020

To Reproduce
Steps to reproduce the behavior:

  1. Go to /learn or /settings with the theme set to dark
  2. Turn off internet connection and wait

Actual behavior
The offline warning message shows up, but the text is quite hard to read.

Screenshots

Screen Shot 2020-11-09 at 12 22 16 AM

@huyenltnguyen huyenltnguyen added type: bug Issues that need priority attention. Platform, Curriculum tests (if broken completely), etc. platform: learn UI side of the client application that needs familiarity with React, Gatsby etc. labels Nov 8, 2020
@ShaunSHamilton
Copy link
Member

WCAG does say the contrast is only 1.41: https://contrastchecker.com/?c=f5f6f7&b=add8e6

@ahmaxed
Copy link
Member

ahmaxed commented Nov 10, 2020

The notification background is hardcoded and the font color is being handled based on theme.

We have let bootstrap handle the styling for the notifications since they handle the font color and the background and look well on both themes.

So doing the followings should do the trick.

Add alert-info as a class here:

and remove the background from here:

@ahmaxed ahmaxed added the first timers only Open for anyone doing contributions for first time. You do not need permission to work on these. label Nov 10, 2020
@rammazzoti2000
Copy link

rammazzoti2000 commented Nov 10, 2020

I think the best way is to implement luma-corrected calculations.
The first obvious implication of going with a luma-corrected approach is that the notification background color needs to switch to an RBG declaration for the backgrounds, calculate the luma from whatever method we choose, and use it on the foreground color declaration, which can (and will) still be HSL color.

I am saying this because this would allow the font color to switch based on the contrast of the notification background contrast from white to black and vice versa.

Source: https://css-tricks.com/switch-font-color-for-different-backgrounds-with-css/

@redshark25
Copy link

redshark25 commented Nov 10, 2020

@ahmadabdolsaheb can I work on this? I might need help. please guide me.

@ahmaxed
Copy link
Member

ahmaxed commented Nov 12, 2020

@rammazzoti2000, that is a cool trick. Thanks for sharing the link.

Since are planning to move off of bootstrap, we should consider luma-corrected calculations in how we implement our dark/light themes during the rewrite process.

Meanwhile, I think we could move forward with making the simple change that resolves this issue.

@redshark25, sure. Make sure you read this: https://contribute.freecodecamp.org/#/index?id=our-open-source-codebase

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
first timers only Open for anyone doing contributions for first time. You do not need permission to work on these. platform: learn UI side of the client application that needs familiarity with React, Gatsby etc. type: bug Issues that need priority attention. Platform, Curriculum tests (if broken completely), etc.
Projects
None yet
5 participants