fraoustin / redmine_dark

add dark theme for redmine
GNU General Public License v2.0
28 stars 8 forks source link

Don't displayed button "dark mode" #3

Open Yarrax opened 1 year ago

Yarrax commented 1 year ago

I use redmine 4.0.5.stable. After install redmine_dark on sema desktops i can't find dark mode button:

I disable all extensions, but has no effect. Is it a bug in plugin?

alterdaemon commented 1 year ago

I confirm under 4.2, there's no button for activation/deactivation

fraoustin commented 1 year ago

Hi

I test the plugin on redmine 4.2 and 4.0 and i have a link "dark mode"

image

For test i use docker ... my Dockerfile is

FROM redmine:4.2

WORKDIR /usr/src/redmine/plugins
RUN git clone https://github.com/fraoustin/redmine_dark.git

WORKDIR /usr/src/redmine/

i build my image and run

docker build -t myredmine .
docker run -p 3000:3000 myredmine

image

can you check html code of your main page an search dark mode please.

Your redmine is public access, I can see it?

Yarrax commented 1 year ago

Yes, i found dark mode code:

if i use Alex skin If i use standart skin. Our redmine is public, but i cant use your plugin at worktime, sorry :( If it will help i can save and public html-code of main page with dark_plugin
fraoustin commented 1 year ago

you have a button

image

Yarrax commented 1 year ago

No, i haven't button. It may be firefox version specific bug? изображение

fraoustin commented 1 year ago

on firefox i have a button ... but you can check the javascript console please. (F12 for access to console)

Yarrax commented 1 year ago

image On my home desktop (openSUSE Leap 15.3)

image Looks like right code... but dark button don't displayed

Yarrax commented 1 year ago

Okay.. some updates. On windows in firefox 107.0.1 (64 bit) button also not displayed. изображение

It's stiill looks like firefox problem. Iv vivaldi. edge and other chrome-like browsers button is displayed. But firefox our main browser =(

Yarrax commented 1 year ago

I understood what;s wrong! Firefox has option - themes for sites. If i use "automatic" option + dark firefox theme or "dark" option for sites, "dark mode" button is hidden. If I use "automatic" option + light frefox there or "light" option - "dark mode" button s dispayed.

It's not obvious, but it doesn't look like a bug. But i have a quiestion - is it possible display this button if i use "dark" option for sites in firefox?

Anyway i whant to say great thanks for this module. My eyes is safe :)

UPD. Also i must say, that dark mode wouldn't work correct if in chrome-based browser will be enabled experimental option "Auto Dark Mode for Web Contents". Firefox work with that option more correct. But "dark mode" button is dispayed in chrome-based browsers with that option.

EnBiKami commented 1 year ago

Hello @Yarrax, I've encountered same issue, it is caused by dark.css file that is checking @media and if dark mode is selected as main theme it will hide mentioned buton and force dark mode in redmine, if you would remove everyting after @media(including @media) it will always show and respect selected mode @media (prefers-color-scheme: dark) {

dark {

    display:none;
}