Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2019-04-05 09:50:49

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,446
Website GitHub

Re: Dark/Light Mode in 4.8-dev Hive admin theme

philwareham wrote #317503:

It has to stay on every page because it’s a JS widget not part of the Textpattern codebase.

While I don’t have a major problem with it being omnipresent, I can see what phiw13 means. It’s not something you’re going to toggle every few minutes or need all the time. Either your browser will take care of it for you at sundown/sunrise or you’ll flick to dark/light mode on purpose as a one-off and then use the admin interface in that mode.

To that end, is there any mileage in only including the widget on, say, the prefs panel by wrapping the lightbulb with a check to see what global $event is in use and only showing the thing if it matches prefs?

The JS that hooks into it to handle the toggle state should just fail gracefully if the target element isn’t on-screen. If not, it can be tweaked to fail gracefully. When the localStorage object is set, it’ll stay that way on all screens because darkmode.js and main.js are included all the time.

Just a thought.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#14 2019-04-05 10:10:19

philwareham
Core designer
From: Haslemere, Surrey, UK
Registered: 2009-06-11
Posts: 3,564
Website GitHub Mastodon

Re: Dark/Light Mode in 4.8-dev Hive admin theme

It has to stay on every page because it’s a JS widget not part of the Textpattern codebase.

OK, I was using doublespeak there. Basically I’m fairly happy with it being on every page – in leu of a better Textpattern prefs system where specific theme prefs could be stored via localStorage. You can always hide it with some custom CSS anyway if you don’t like seeing it, and let the OS decide what mode you use. I’ve put the code to do that hiding into the custom-example.css file now.

Offline

#15 2019-04-05 12:12:02

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,189
Website

Re: Dark/Light Mode in 4.8-dev Hive admin theme

Bloke wrote #317504:

To that end, is there any mileage in only including the widget on, say, the prefs panel by wrapping the lightbulb with a check to see what global $event is in use and only showing the thing if it matches prefs?

That sounds more interesting – and kinda in line with this issue. Site specific preferences is something that I eventually would like to see implemented. Disabling that script that resizes the textareas in Hive is but on other use case.

philwareham wrote #317503:

The blue link contrast has now been adjusted to give a WCAG 2.0 AAA rating.

Thanks for that, definitively an improvement.

A question: are the buttons input[type=submit], button, etc set in stone? Or are they also gonna get a darker shade on the dark mode side? At present they are a light grey, kinda too visible on the dark background.


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#16 2019-05-03 07:31:12

LatteLover
New Member
Registered: 2019-04-23
Posts: 1

Re: Dark/Light Mode in 4.8-dev Hive admin theme

colak wrote #317499:

I guess that people might switch it on and off. During the day, one might prefer the light mode and from some point on, the dark one.

I like it but I’m not sure about the contrast between the dark greys and the blue of the links for those who may have accessibility issues or even just bad screens.

Exactly. I am that person.

Offline

Board footer

Powered by FluxBB