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

Elastic: Dark mode #6709

Closed
chris-kruining opened this issue Apr 3, 2019 · 30 comments
Closed

Elastic: Dark mode #6709

chris-kruining opened this issue Apr 3, 2019 · 30 comments

Comments

@chris-kruining
Copy link

Would love to have a toggle to swap the color palette of the new elastic skin to a 'dark mode'. I technically could ask the server maintainer to change the .less files, but then I imagine the change would be for everybody, which is undesirable.

@alecpl
Copy link
Member

alecpl commented Apr 4, 2019

There's some work on this front in #6691.

@chris-kruining
Copy link
Author

awesome!

@alecpl alecpl removed this from the 1.5-beta milestone Jun 6, 2019
@thrdroom
Copy link

Why was this removed from the 1.5-beta milestone? Is there a new milestone for this feature/theme?

@mcnesium
Copy link
Contributor

mcnesium commented Jun 5, 2020

As a workaround to this we can add some tiny CSS snippet to the stylesheet, that just inverts the colors of everything plus rotates the colors back to their original tone, and then re-inverts images and iframes (the actual mail content).

Since I run RC in Docker, I volume-mount the stylesheet into the container. Here is the script I run after each update:

#!/usr/bin/env bash

CSS="
@media (prefers-color-scheme: dark) {
    body img,
    body iframe,
    body {
        filter: invert(1) hue-rotate(180deg);
    }
}
"

# copy possibly updated stylesheet
docker cp roundcube_app:/var/www/html/skins/elastic/styles/styles.css styles.css

# append the CSS snipped to the file
echo "$CSS" | xargs >> styles.css

# restart container to apply changes to the mounted stylesheet
docker-compose restart app

It then looks like this (minus the blurryness):

Screenshot from 2020-06-05 11-31-35

@ghost
Copy link

ghost commented Jun 23, 2020

Check it: Roundcube Elastic Dark, required Stylus

@thrdroom
Copy link

thrdroom commented Jun 23, 2020

Check it: Roundcube Elastic Dark, required Stylus

Please port your theme to roundcube as a native theme. Browser extensions like Stylus are just a workaround and not a proper solution. Thanks

@thrdroom
Copy link

@alecpl Why was this removed from the 1.5-beta milestone? Is there a new milestone for this feature/theme? Why was this issue closed when there is still no dark theme for elastic? tia

@alecpl
Copy link
Member

alecpl commented Jun 23, 2020

The ticket was closed by his author. I guess we can re-open.

@alecpl alecpl reopened this Jun 23, 2020
@alecpl alecpl added this to the later milestone Jun 23, 2020
@alecpl alecpl modified the milestones: later, 1.5-beta Jul 7, 2020
@alecpl alecpl changed the title elastic skin dark mode Elastic: Dark mode Jul 7, 2020
alecpl added a commit that referenced this issue Jul 7, 2020
@alecpl
Copy link
Member

alecpl commented Jul 7, 2020

I just pushed the initial implementation to master. Work in progress. https://kolabian.wordpress.com/2020/07/07/elastic-dark-mode/

@chris-kruining
Copy link
Author

chris-kruining commented Jul 8, 2020

awesome, thank you for your hard work!

@gianlucagiacometti
Copy link
Contributor

great job indeed!

@alecpl
Copy link
Member

alecpl commented Jul 18, 2020

I consider this done. If you find any issues create a new ticket(s).

@alecpl alecpl closed this as completed Jul 18, 2020
@Advewave
Copy link

where can i find the option for this? it isn't specified in your blog post and i cannot find it on my own roundcube installation.

@alecpl
Copy link
Member

alecpl commented Jul 22, 2020

@Advewave This hasn't been released yet. The beta version is planned somewhere in the end of 2020.

@poblabs
Copy link

poblabs commented Sep 12, 2020

Downloading the master repo and uploading the skins/elastic initially gave me an error about the deps folder missing, so I merged it with my existing elastic theme folder, yet it doesn't give me the dark menu. Is there a way to activate it?

I can see it enabled in meta.json.

@AlphaJack
Copy link

@alecpl Any update on the beta version?

@alecpl
Copy link
Member

alecpl commented Dec 21, 2020

There's a tremendous amount of work needed for PHP8 support, so maybe next month.

@DoCheckor
Copy link

Can't wait!

@mkmark
Copy link

mkmark commented Jan 31, 2021

Please port your theme to roundcube as a native theme. Browser extensions like Stylus are just a workaround and not a proper solution. Thanks

mkmark/elastic-dark

Here is a personal dark theme built based on an earlier version of the official Elastic theme. Tested on 1.4.6 and 1.4.10 (latest stable 20210131).

@Offerel
Copy link

Offerel commented Mar 9, 2021

One question: Is it possible to auto-enable the dark mode, upon browser request? For example, if a browser switch to night time automatically to dark mode, can this browser request an automatic switch to dark mode for elastic skin?

@mkmark
Copy link

mkmark commented Mar 10, 2021

One question: Is it possible to auto-enable the dark mode, upon browser request? For example, if a browser switch to night time automatically to dark mode, can this browser request an automatic switch to dark mode for elastic skin?

Yes. See prefers-color-scheme

@Offerel
Copy link

Offerel commented Mar 10, 2021

Currently it seems not to be implemented. At least I tested it with Firefox mobile. If I switch Android and with that Firefox, to dark mode, elastic stay with the bright theme. I must switch manually to the dark theme.

@mcnesium
Copy link
Contributor

There is a clue in the layout but it is invoked by javascript. This might lead to unexpected behaviour and leaves the question behind, why it is not baked into the CSS directly.

@alecpl
Copy link
Member

alecpl commented Mar 10, 2021

There's also code in ui.js that catches prefers-color-scheme changes. Works for me when switching prefers-color-scheme using developer tools in Firefox as well as Chromium on Linux. So, maybe this is Firefox mobile issue. Do you have it working with other pages?

@Offerel
Copy link

Offerel commented Mar 11, 2021

Yes, it's working fine on all other sites with Firefox Android stable. For example https://arnowelzel.de/automatischer-dark-mode-websites

@alecpl
Copy link
Member

alecpl commented Mar 11, 2021

Please, check with a7b9d76. Delete the cookie first.

@Offerel
Copy link

Offerel commented Mar 11, 2021

At least with this change, dark mode is set equal to system mode, if the browser follows the system setting. Many thx. I have another wish for the mail list view, will open a new request for this.

@mcnesium
Copy link
Contributor

@alecpl no offense, just curious: could you explain, why you are using javascript to invoke this instead of a media query?

@alecpl
Copy link
Member

alecpl commented Mar 11, 2021

To have it easily available everywhere, e.g. on my desktop browser. Maybe at some point we can remove the button and do it only automatic.

@AlphaJack
Copy link

Is there a way to enable the dark mode everywhere by default, including the login screen?

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

No branches or pull requests