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

Add night theme #2969

Closed
Kyuuu opened this issue Aug 21, 2019 · 18 comments · Fixed by #9361
Closed

Add night theme #2969

Kyuuu opened this issue Aug 21, 2019 · 18 comments · Fixed by #9361
Assignees
Labels
enhancement Adding or requesting a new feature. undecided These features might not be implemented. Can be prioritized by sponsorship. ux Issues related to user experience.
Milestone

Comments

@Kyuuu
Copy link
Contributor

Kyuuu commented Aug 21, 2019

Is your feature request related to a problem? Please describe.
I like to work at night. It would be nice to give my eyes some rest and be able to switch between day and night mode at any time.

Describe the solution you'd like
Possibility to switch between these modes.

Describe alternatives you've considered
//

Additional context
//

@nijel nijel added enhancement Adding or requesting a new feature. undecided These features might not be implemented. Can be prioritized by sponsorship. ux Issues related to user experience. labels Aug 21, 2019
@Kyuuu
Copy link
Contributor Author

Kyuuu commented Aug 21, 2019

Day/Night mode switcher position proposal:
daynight

@tomasbranda
Copy link

+1
I agree. I have to decrease my brightness to the lowest level but even that isn't good. Much better would be a dark theme that you could enable right in the Weblate without any extension.

@nijel nijel changed the title DayNight Add night theme Nov 18, 2019
@nijel
Copy link
Member

nijel commented Feb 12, 2020

Not yet, nobody contributed it so far.

@comradekingu
Copy link
Contributor

@Kyuuu If you aren't using custom CSS, or a plugin to do it. Isn't just the next website going to look too bright?
Having every page implement this, even if they all did it the same way, is not a good solution. Android went through this problem with apps and solved it with a system setting https://developer.android.com/guide/topics/ui/look-and-feel/darktheme

@SethFalco
Copy link
Contributor

Just want to note the existence of the prefers-color-scheme feature of CSS to check the user's system preference on light/dark mode.

The prefers-color-scheme CSS media feature is used to detect if the user has requested the system use a light or dark color theme.
- https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme

When/if this gets implemented, it would be nice if Weblate can default to the system theme if not explicitly set in Weblate itself.

@HcgRandon
Copy link

Would love to see this. So my users don't have to have bleeding eyes, nor stop being the night owls they are..

@eUgEntOptIc44
Copy link
Contributor

Hi everyone 👋,

I just generated a dark mode CSS stylesheet for weblate using the Dark Reader browser extension.

I haven't dealt with weblate's source code so far. So unfortunately I have no knowledge considering the JavaScript used.

But generally speaking I'd solve the integration of the light/dark mode switch using either a server-side variable stored with the user's profile information or client-side using preferable local storage or cookies.

Please see the attached CSS file. Please note that the file extension is .txt instead of .css as for unkown reasons the upload of the latter is blocked by GitHub.

📎DarkReader-weblate-dark-mode.css

Regards,

Jean-Luc

@eUgEntOptIc44
Copy link
Contributor

The generation of high contrast or sepia colored themes using the Dark Reader browser extension would be possible as well. So this might improve the accessibility of weblate in general.

@eUgEntOptIc44
Copy link
Contributor

eUgEntOptIc44 commented Dec 15, 2021

I would be very grateful if @nijel could look into this any time soon.

Btw just wanted to express my gratitude for maintaining weblate. It's a awesome piece of software.

@nijel
Copy link
Member

nijel commented Dec 16, 2021

Thanks for sharing the CSS, unfortunately full integration is not that easy.

  • The dark mode CSS needs to be updated when doing other CSS changes. Ideally, this would be automated, otherwise it will be forgotten.
  • The CSS change does not cover some icons in the UI making them really low contrast: image

@yarons
Copy link
Contributor

yarons commented Sep 11, 2022

Switching to SVG/Font based icons instead of images is fairly simple and there's also a way to invert the colors of an image with CSS.

Regarding inverting colors:
https://developer.mozilla.org/en-US/docs/Web/CSS/filter-function/invert

Regarding SVG/Fonts (There are many open source projects such as Feather, etc.), there are some equivalent icons:
Font Awesome: link-simple, crown, lock, eye, etc.
There are some in the other projects but these are quite different than what is already used.

The simplest approach is to create root element in CSS for the dark/light mode and switch when necessary.

I created an example here:
https://github.com/Maagan-Michael/dud-design

Thanks :)

@SethFalco
Copy link
Contributor

SethFalco commented Sep 11, 2022

The CSS change does not cover some icons in the UI making them really low contrast

I haven't checked the code, but I would assume those icons are SVGs.
If you just change the fill attribute to the value currentColor (supported in all major browsers) it'll inherit the color (font color), from there it'll be easy to override between themes.

Should be an easy fix for the icons, and is not a hack. (This is how things like FontAwesome achieve setting the color of their icons through CSS.)

@nijel
Copy link
Member

nijel commented Sep 12, 2022

Yes, using fill is probably the way to go. We already use that for coloring SVGs (and all icons are SVGs). It was just a statement that CSS in #2969 (comment) does not cover this.

@rex2630
Copy link

rex2630 commented Jan 27, 2023

Any update on this? That white mode is killing me :/

@nijel nijel added this to the 4.18 milestone Apr 13, 2023
nijel added a commit that referenced this issue Jun 7, 2023
This is needed for coloring them in #2969
nijel added a commit to nijel/weblate that referenced this issue Jun 7, 2023
- add CSS override for dark theme
- add javascript to toggle that
- TODO: add user configuration with peristence (probably using local
  storage or cookies to make this device specific)

Fixes WeblateOrg#2969
@nijel nijel mentioned this issue Jun 7, 2023
5 tasks
@nijel
Copy link
Member

nijel commented Jun 7, 2023

Draft PR for this is available at #9361

What is missing is user configuration, and I'm hesitating here whether to make it in user settings and for all devices, or store it in the browser and have it per device.

@Kyuuu
Copy link
Contributor Author

Kyuuu commented Jun 7, 2023

Draft PR for this is available at #9361

What is missing is user configuration, and I'm hesitating here whether to make it in user settings and for all devices, or store it in the browser and have it per device.

Thank you for working on this issue!
I would love to have it for all devices in the same time. So user settings for me and I think others will be the same since if someone likes having things dark it will be the same with all apps everywhere

@Kyuuu Kyuuu closed this as completed Jun 7, 2023
@poVoq
Copy link

poVoq commented Jun 7, 2023

IMHO this should not be stored anywhere but be left to the browser preference setting.

@nijel nijel reopened this Jun 8, 2023
@nijel
Copy link
Member

nijel commented Jun 8, 2023

The browser preference works already in the PR. Most sites allow you to configure this as well. Or is it no longer useful these days?

nijel added a commit to nijel/weblate that referenced this issue Jun 8, 2023
- add CSS override for dark theme
- add javascript to toggle that
- TODO: add user configuration with peristence (probably using local
  storage or cookies to make this device specific)

Fixes WeblateOrg#2969
nijel added a commit to nijel/weblate that referenced this issue Jun 8, 2023
- add CSS override for dark theme
- add javascript to toggle that
- allow to override this in the profile

Fixes WeblateOrg#2969
nijel added a commit to nijel/weblate that referenced this issue Jun 8, 2023
- add CSS override for dark theme
- add javascript to toggle that
- allow to override this in the profile

Fixes WeblateOrg#2969
nijel added a commit to nijel/weblate that referenced this issue Jun 8, 2023
- add CSS override for dark theme
- add javascript to toggle that
- allow to override this in the profile

Fixes WeblateOrg#2969
orangesunny added a commit that referenced this issue Jun 9, 2023
* css: Add dark theme

- add CSS override for dark theme
- add javascript to toggle that
- allow to override this in the profile

Fixes #2969

* rephrasing docs

---------

Co-authored-by: Benjamin Alan Jamie <benjamin@weblate.org>
@nijel nijel self-assigned this Jun 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Adding or requesting a new feature. undecided These features might not be implemented. Can be prioritized by sponsorship. ux Issues related to user experience.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants