-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
feat($theme-default): support darkmode (close #1865) #2301
base: master
Are you sure you want to change the base?
Conversation
packages/@vuepress/theme-default/styles/custom-blocks-dark.styl
Outdated
Show resolved
Hide resolved
Could anyone review this PR? I believe it's an amazing feature. Nearly half a month has passed, you can just release |
@Mister-Hope Have you verified if this will work in IE11? It would be ideal for us to avoid having the theme break due to incompatibility with CSS variables. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Mister-Hope Thanks for your work on this. The main questions that need to be answered for this theme include:
- Does it work on IE11 and other browsers?
- Does it pass accessibility checks?
I know that the work involved for these parts are fairly involved. So at this time, if you'd like to have your work shared with others, I would recommend creating a separate atomic theme that other people can use since it may take some time before this can be integrated as an official dark theme.
|
Since last year september, I feel like your whole team is on vacation ( You could not deny it), I even open a issue #2144 . More and more people give up using it. Also, I post my theme to awesome-vuepress , but ulivz is totally disappeared, that means I donot have a platform to post my theme. I like this project, so I spend a lot of time developing a good doc and blog theme. It has the most features among all the theme I known. Besides, as far as I know, there are plenty of people willing to have this darktheme, so I spend time make one. If you can contact ulivz, I really wish you can request him to transfer awesome-vuepress under vuepress-community, at least meteorlxy is active. @bencodezen |
@Mister-Hope That must have been frustrating. Onboarding the new team has certainly been a challenge and we are looking to make changes to the process in order to reduce issues like you mentioned. I have reached out to Ulivz in hopes of getting access to the repos since unfortunately it looks like none of us have access to keep those updated. Once we do, I will make sure those are kept up to date as well. In the meantime, you raise excellent points that I intend on addressing. For now, don't worry about the accessibility checks since we will need a full audit on both official themes; but to your point, it would be better to give people access to a dark theme so they have somewhere to start. Could you make sure that the checks pass IE11? My main concern is the CSS variables which I don't believe is supported. |
I will add ie11 support these days |
@Mister-Hope Sounds great. Thank you for your patience and I look forward to getting your PR merged soon! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution, but following CSS is a better and lightweight implementation.
body {
filter: invert(100%) hue-rotate(180deg);
}
Hi @Mister-Hope Do you plan to keep working in this PR? I'm very interested in it. Maybe you could release this as a standalone theme |
I have a theme called vuepress theme hope |
@Mister-Hope Do you need help on this? |
Yes, please. I am busy now,I am planning to add a fallback color before all the css vars and I think it will works fine on IE. |
@Mister-Hope Thanks for all your effort, it is a pity this feature is not still there |
|
This really isn't a better implementation. Emoji and images will have their color inverted. Images can be corrected by filtering and rotating the hue again, but this is wasteful on the client's resources, especially for older machines. Try scrolling on a longer Vuepress page on any older retina Mac with this solution, Chrome will have a hard time keeping up with the page rendering. Applying this CSS to just the body will result in shorter pages displaying white at the bottom of the screen. Targeting the html tag instead works for Chrome and Safari, but Firefox behaves differently, showing white at the bottom of shorter pages still. Not the reply I'd expect to see from a core team member. I don't think this PR is the solution, but substantial work should be done to build a vuepress theme which respects the color scheme of the client machine and not just patched with a quick fix. |
@Mister-Hope @kefranabg hello, thank you for your work. Any updates for now? |
Nope, V2 may support this. now you can try my theme called vuepress-theme-hope |
@Mister-Hope will you add IE11 support to match merge requirements from the reviewer? |
to be honest, I am not pretty interested now. As you can see, no core contributor is maintaining V1 now, they are just reviewing PRS, and even you turn to vitepress. Also, V2 version is nearl complete by meteorlxy. And he is planing to support darkmode. |
@Mister-Hope what is vitepress? And where I can found v2? |
@Mister-Hope Would you like to transform this PR to v2? |
I would like to,but I think a full rebuilt of style would be better.(dropping stylus) |
Yep, just like what we discussed before. I was considering to drop the v1 layout system, and only support one Layout and one NotFound like v0 & vitepress. That was the reason why I didn't suggest to refactor the style in a rush. But now I still can't determine if that is necessary, so we'd better not be stuck with it, and go ahead to refine our current theme & plugins. |
Since I am using plugin-blog, I would prefer to remain the layout system. Otherwise the Layout.vue would be too complicated. |
Summary
Add darkmode feature to
@vuepress/theme-default
.Meanwhile, moving some variables to
@vuepress/core/client/styles/config.styl
What kind of change does this PR introduce? (check at least one)
Does this PR introduce a breaking change? (check one)
If user is using dark theme on their device, darkmode will be enabled automatically.
You have tested in the following browsers:
If adding a new feature, the PR's description includes: