Comments (12)
Thanks, I will optimize my docs.
v1.0.9, defaultTheme work with a postcss plugin css-prefers-color-scheme/postcss
.
v1.1.0, i just use html[theme=light] html[theme=dark]
replace css-prefers-color-scheme/postcss
.
from vuepress-theme-default-prefers-color-scheme.
Maybe my request wasn't clear.
I was not asking for a button. I prefer the dynamic nature of the plugin, as does @spawnia. I guess we both are asking for a way to override the vuepress core default theme while following browser preferences if set.
A solution might be a change in the ranking of the individual settings?
from vuepress-theme-default-prefers-color-scheme.
The name defaultColor
is misleading, since it does not change the default but rather overrides any other setting.
I advocate to restore it to its previous behavior of actually functioning as a default. Totally overriding user preference goes exactly against what I want out of this package.
from vuepress-theme-default-prefers-color-scheme.
How about just adding in a second option called overrideTheme
to have a way to force a theme and reverting defaultTheme
to function as the fallback in case the user has no preference?
from vuepress-theme-default-prefers-color-scheme.
You should remove the defaultTheme, The defaultTheme invalidates the prefers-color-scheme
from vuepress-theme-default-prefers-color-scheme.
Thanks for the response.
I think that this configuration is misleading, I would not expect the defaultTheme
to just set the theme. My impression was that the entire point of this plugin was to have the theme be dynamic, overruling that through a setting invalidates its usefulness.
On another note: This was a breaking change, assuming you follow semantic versioning it warrants a major version bump.
from vuepress-theme-default-prefers-color-scheme.
Assuming the order of preferences is:
defaultTheme
's default- overriding
defaultTheme
- brower preferences
The current behavior as of v1.1.2
is that overriding defaultTheme
also overrides the browser preferences contrary to me assuming it should only override the (vuepress core) default light theme (for time slots) not the browser preferences as well.
I also assume @spawnia meant to imply the same above with his comments.
@tolking Where and how do I set a "default" dark theme for old browser's not preferring either a light or dark theme? Looking at the third section of:
https://caniuse.com/?search=prefers-color-scheme
this seems to be the same issue with @spawnia 's Chrome browser not communicating a default theme on Windows with the current release.
from vuepress-theme-default-prefers-color-scheme.
@jrappen The defaultTheme
overrides the browser preferences, it is true.
It does bring some troubles to use.
I have an idea, it is delete defaultTheme
then add a button to control show auto
light
or dark
theme (It should be a built-in plugIn). Will this be better understood than now
from vuepress-theme-default-prefers-color-scheme.
I know what you mean. But from the beginning, The defaultTheme overrides the browser preferences, I can't destroy it now.
If need to control the themes
when the prefers-color-scheme not working, I can only add one config now. This may cause more trouble
from vuepress-theme-default-prefers-color-scheme.
But from the beginning, The defaultTheme overrides the browser preferences
That was not the case in 1.0.9, back then the browser preference won over the defaultTheme
.
from vuepress-theme-default-prefers-color-scheme.
v1.0.9, defaultTheme work with a postcss plugin css-prefers-color-scheme/postcss.
Adding overrideTheme is possible
from vuepress-theme-default-prefers-color-scheme.
Thank you @tolking for addressing this issue and a great v2
from vuepress-theme-default-prefers-color-scheme.
Related Issues (13)
- how to change color HOT 2
- Add support for PWA popup HOT 3
- Typo in palette.styl HOT 2
- 设置时间段后不正常显示 HOT 2
- Missing variables HOT 1
- dark mode colors suggestion
- Toggle dark mode HOT 1
- something wrong in warning and danger tips HOT 2
- Workflows HOT 2
- Enabling the theme on vuepress2 gives error on compilation HOT 2
- Scroll bar HOT 1
- code textcolor in light mode HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vuepress-theme-default-prefers-color-scheme.