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

Dark theme #969

Open
wants to merge 28 commits into
base: master
Choose a base branch
from
Open

Dark theme #969

wants to merge 28 commits into from

Conversation

xhdix
Copy link
Contributor

@xhdix xhdix commented Sep 27, 2021

Automatic dark mode in Firefox and Chrome.
There is also a button to change it in browsers that have this feature disabled, like Tor and Duckduckgo.
Notes:

  1. it is not complete/perfect.
  2. The color scheme is based on https://design.ooni.io/

image
image

  • make sure that outreach happens
  • when merging, double check that the publication date is today

@hellais
Copy link
Member

hellais commented Sep 29, 2021

Thanks for putting this together!

I think we should do a couple of improvements to it before merging it:

  • Is there a way to implement this without using the CSS var property? It doesn't appear to be supported in IE. In general 5% of browsers will break if we use this, see: https://caniuse.com/mdn-css_properties_custom-property_var.
  • We should move the dark mode theme switcher into the footer so as to not take up so much space in the navbar
  • I think the primary OONI Blue color should be adjusted to be a hint bit darker, like we do on mobile. The specific color code for it is: #056aa6 (see: https://github.com/ooni/probe-android/blob/master/app/src/main/res/values-night/colors.xml)
  • Some parts of the website require a bit more tweaking to not break with the darker colors. What follows are screenshots of the pages affected by issues when switching to dark mode:
    • The PGP key in the contact section is not legible: Screenshot 2021-09-29 at 16 17 30
    • This section in the install page should be inverted in color as well. I would suggest using #495057 and white text Screenshot 2021-09-29 at 16 17 57
    • The OONI Probe logo in the install page should be the white version:
      Screenshot 2021-09-29 at 16 25 22
    • The back button and the website button need to be inverted in colors on the partnership page: Screenshot 2021-09-29 at 16 18 25
      )
    • These icons need to be re-exported with the correct alpha layer on them so that they don't lead to the white border around them. Even better perhaps is using in the case of the dark theme the white versions: Screenshot 2021-09-29 at 16 18 48
    • I am not too convinced about the colors in the test page. I guess if we adjust the base OONI Blue color maybe it's doing to work, but we should verify that too: Screenshot 2021-09-29 at 16 18 56

@xhdix
Copy link
Contributor Author

xhdix commented Oct 1, 2021

All done, except moving the theme switcher into the footer. I don't know exactly where! (Also, I think, users should be aware of the ability to change the theme before reading, not after.)

Now in IE:
image
(The theme switcher does not work in IE. Do I need to add? The CSS/JS size will be slightly larger.)

I also slightly changed the partner pages just for the dark theme:

I did not have a good editor for SVG, so you need to change the API logos:

  • /data/ooni-api.svg
  • /data/ooni-api-inverted.svg

Let me know if there is anything I can add or change.

@xhdix
Copy link
Contributor Author

xhdix commented Oct 5, 2021

There are also several images with no background and black text.
image
image

I can apply this change:

master.css:937
.blog-post img {
++  background-color: var(--partner-logo-color);
}

image
image

Or I can add a background to those images and replace them.

Which do you prefer?

@xhdix
Copy link
Contributor Author

xhdix commented Oct 6, 2021

@hellais, new changes applied, please review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants