-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[IDEA] A Toggle Button for Simple Switching Dark/Light Theme for Tiddlywiki 5.1.23 #5023
Comments
@BurningTreeC Is this something you might want to tackle? Even if it doesn't make it into the core right away, I think it would be a nice plugin. JD has already done most of the groundwork in #4769 |
@saqimtiaz we'd need a dark / light equivalent for every theme... I don't know if we do. But I'd like to tackle this, yes |
@BurningTreeC I was thinking we just let the user directly choose a dark and light palette as part of a config option. |
Good idea @saqimtiaz ! |
@BurningTreeC do have a look at JD's implementation in #4769, some good ideas in there |
Just to complicate things, there is a media query for detecting the users preference for dark mode vs. light mode: https://css-tricks.com/dark-modes-with-css/ $:/core/modules/info/platform.js could use |
@Jermolene, that's a nice idea. I already did so, but now I need some ideas how to make use of it |
I get the impression that people like websites that automatically adapt to the prevailing display mode, so I think that would be a good starting point. We should also listen for changes using the technique shown in https://flaviocopes.com/javascript-detect-dark-mode/ Having said that, we may want to keep this back until after v5.1.23... |
yes @Jermolene, I also want to keep this back until after v5.1.23 |
I think it would be good to give this a run as a plugin, or an early part of 5.1.24-prelease to get user feedback. |
@Jermolene - I tried using In the colour macro then we can do |
I think switching between themes is already a button, that can be used that way. Do we really need complex CSS? |
The rationale for a modal switcher is that it is outside the main page container in the DOM, and hence can't be disrupted by a faulty page layout. |
I love that there are system/media-query hooks to use. I implemented this as a simple light/dark toigle sidebar button in my silat (martial arts) wiki: https://silat.chronicles.wiki (Part of my PageTools plugin that I have to rework now that we have toggle[] and cycle[]. I also got a couple of good svgs to use there.) |
@Jermolene , I don't want to create a new issue for this question: why does the framed editor extract the background-color from the currently used palette and set it for the iframeNode and domNode, if we can style them through a Stylesheet, which makes it also easier to modify styles... ? |
Hi @BurningTreeC the issue is that we can't style the contents of the iframe from the main stylesheet, so we style an off-screen text area and then copy the styles one by one. |
Hi @Jermolene, thanks for the explanation, but I was fiddling around by commenting out the lines that set the background-color to the iframeNode and the domNode and still it works fine styling them via a Stylesheet |
Hi @BurningTreeC I think you might have authored the lines in question: 14003b0 |
Ouch, that was a mistake! |
@Jermolene, I'll revert this with this PR here |
Thanks @BurningTreeC |
Folks, Beyone simple nioght day switching - I support that. Using this filter invert gives me the clue I was looking for, a way to get Icons to be given contrasting colors. Without even knowing the color one can use its rotated hue. _ Somehow I feel this feature could be built into svg display or designs to allow a primary colour to be selected freely knowing its background as an example will contrast. All I ask is when investigating the mechaisium for night/day please also consider it as a way to ensure complementary colors and please avoid compromising future possibilities. Thanks |
Post script, eg using traffic light colors to indicate button status etc... |
@kookma -- I think the Palette-Switcher and Palett-Watch plugin can handle that I think this one can be closed. |
The OP asks to add the feature to the Core! Yes, there are several plugins around to do that, Like Notebook theme, Shiraz, ... |
I'd be inclined to keep this open. Our support for dark mode is still very rudimentary, and I would regard the OP as a reasonable request |
We had better wait until #8555 is implemented and merged. IMO using media query would be better for supporting dark mode. |
Switching between dark/light modes does not necessarily depend on the browsers preferred setting. It's nice to have it, but it also needs independently from browser or even OS settings. |
Tiddlywiki 5.1.23 has a bunch of wonderful new features. With the advent of toggle operator and the nice working dark palettes, yet the current trend for having toggle dark/light on many websites, I may recommend
The text was updated successfully, but these errors were encountered: