Re: Dark mode styling for the website

Поиск
Список
Период
Сортировка
От Dave Page
Тема Re: Dark mode styling for the website
Дата
Msg-id CA+OCxoyOTuRO2R64=dp5XkAnUBLRpVQ3KQ09zAr_20h1Y5aDHg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Dark mode styling for the website  ("David G. Johnston" <david.g.johnston@gmail.com>)
Ответы Re: Dark mode styling for the website
Список pgsql-www


On Wed, 26 Oct 2022 at 20:03, David G. Johnston <david.g.johnston@gmail.com> wrote: 
I agree that the blue-black contrast (e.g., navigation) doesn't seem big enough and also that having the option to flip dark mode on or off on the website itself (cookie memory) would be especially nice.  Having the only control (that I know of) be a system-wide dark mode setting is not desirable for me.

I do appreciate the option and the work that has gone into it.  Just needs a few more tweaks IMO (and some others).

I haven't yet looked into increasing the contrast, but I have pushed the beginnings of a patch to my dev branch that implements manual switching that can override the auto-detected preference. It will use local storage to record your preference for the next visit. You can try it out at:


The only issue I can find at the moment is that this will effectively disable dark mode entirely for users that don't have Javascript enabled. The reason for that is that as far as I can tell, I would need to duplicate the color vars for dark mode auto and dark mode manual in the CSS, and then we'd have to keep them in sync forever. Specifically, we currently have:

media (prefers-color-scheme: dark) {
   :root  {
     --a-fg-color: #2b6da3;
     ....
  }
}

To toggle manually, I've changed that to:

[data-theme="dark"] {
     --a-fg-color: #2b6da3;
     ...
}

I can't find any way to avoid that duplication, if we care about non-JS users. Maybe someone cleverer than me knows a way?

There's also some ugly JS duplication, as apparently we have different base templates for the docs and the rest of the site. I'd probably push the JS into shared files in a more polished patch.

 
Thoughts/comments appreciated.

--

В списке pgsql-www по дате отправления:

Предыдущее
От: Magnus Hagander
Дата:
Сообщение: Re: Broken linkparsing in archives
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: Dark mode styling for the website