-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
Updated docs site dark and light mode with switch and redesigned search bar using docsify-darklight-theme #1182
Conversation
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.
Looks good to me.
Can we have the search bar not changed?
also,please fix the CI issue.
other looks good.
also, can we have the old font ? |
are you sure you want to have old search bar ?
Can you please explain this in detail
sure! |
yes, that's the one shipped by default. So we need to show that. |
Yes I will change it to default style. |
that new search bar was neat, but better to keep the default (non-breaking change) for now. It would be great to provide style addons though. Would be happy to accept a PR that can add (for example) a CSS file that someone can optionally import to have an alternative search bar (or theme), etc. Also take a look at docsify-themeable by @jhildenbiddle. That extension makes great use of CSS variables for theme customization. I think it would be great to have a system like that in core (but with the default theme), and then @jhildenbiddle's theme can be an additional (optional) theme that builds on top of that system. Maybe each theme can have its own variables. There's some stuff in docsify-themeable that would be great in core by default, while some stuff (like the actual theme) would be great as an optional theme file. |
did you meant this search bar ? #1182 (comment) |
I meant the one with rounded corners in the "after" shots. But the new dark one looks great too. |
rounded one was the proposed one, I asked for the old one. do you prefer the rounded one ? |
Looks like this has already been merged, unfortunately. I'll provide more information before the end of the day for why we should revert this change. |
@anikethsaha, @trusktr --
I think @boopathikumar018 has done a nice job with docsify-darklight-theme, so I don't want the above to sound discouraging. My feedback is less about this particular theme/plugin combo and more about what's best for docsify (IMHO, anyway). If a better dark/light theme switcher is what we're after (and that is how this PR was pitched), I suggest the following:
The advantage of the steps above comes down to flexibility: both docsify and docsify-themeable could use the plugin to swap between their own "official" dark/light themes (vue.css/dark.css for docsify, "simple" and "simple-dark" for docsify-themeable). More importantly, users would be able to select their own dark/light themes, perhaps mixing themes from different authors. |
I didnt test that in IE11. (Sorry, It was my bad ) Also i agreed with the docs site as a point of reference by docsify users. IMO, let's remove any dark mode plugin in the official docs. We have planned to keep it officially from the core in the next version (v5), so I don't think we should have it now. @boopathikumar018 You did an amazing work with the plugin, but as mentioned by @jhildenbiddle , your plugin is changing the default theme which we should not have as this is one of the active examples of docsify users. I am reverting this and will remove the old dark mode plugin as well. |
It'd be neat to hook up a test system that runs for each pull request that can lets us see/test how the site works in various browsers. I see in some PRs not all browsers are tested (the check boxes from the PR template are not checked). It is difficult for someone in macOS, for example, to test IE 11. I found some tools online, and some of them (if not all) have a free-for-open-source option:
It'd be super sweet to click a link (generated by a bot) in a pull request that takes you directly to the live site in a specific browser. @jhildenbiddle How do you currently test in IE11?
@anikethsaha Why remove it? Shouldn't we keep it, then as @jhildenbiddle mentioned it will be toggleable with a switch? |
@boopathikumar018 Would you be interested in implementing the style toggle switch like @jhildenbiddle mentioned above? Basically,
Then your new/improved dark theme could be an option that people can opt into by specifying it with the new config option. |
the old one was buggy as well. so I removed both |
I would prefer a dark mode from core instead of plugin. |
What do you mean "from core" vs "from plugin"? Styles are just CSS files (currently). I think the new feature that @jhildenbiddle suggests would simply let users list which style files to use for light and dark. We might have default values for those. But I don't see why to delete them if we can just fix the bugs. |
Like without plugin as the sidebar, other navbar items are implemented.
Yea we can, also needs to change the styling for that as well if we are considering that cause it is not so good looking. Note: the old dark mode was not working properly as respect to styling with other themes we provide. |
Since docisfy-themeable offers a light and dark theme already, these will be available as part of v5. "Simple" Theme "Simple Dark" Theme Users can select one of these themes, or they can include both stylesheets and leverage the <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/docsify-themeable@0/dist/css/theme-simple.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/docsify-themeable@0/dist/css/theme-simple-dark.css" media="(prefers-color-scheme: dark)"> We also have the option of simplifying this setup for users by offering light/dark theme selection as part of their docsify configuration. Docsify can then inject the necessary <script>
window.$docsify = {
lightTheme: 'https://path/to/light-theme.css',
darkTheme: 'https://path/to/dark-theme.css'
// ... etc.
}
</script> No toggle necessary (for operating systems that support it, which means the latest versions of Windows and macOS), and I'd argue this is what "dark mode" users expect (why make them manually toggle when they have already indicated "I prefer dark mode" via their OS?). A toggle might be a nice option for those on older operating systems that don't offer a "dark mode", but I'm not convinced it needs to be core docsify functionality. Seems much better a plugin, IMHO. |
Summary
What kind of change does this PR introduce? (check at least one)
If changing the UI of default theme, please provide the before/after screenshot:
Updated docs site dark and light mode with switch and redesigned search bar using docsify-darklight-theme you can refer the docs and see full preview here
Light Mode
before
after
Dark Mode
before
after
Does this PR introduce a breaking change? (check one)
If yes, please describe the impact and migration path for existing applications:
The PR fulfills these requirements:
fix #xxx[,#xxx]
, where "xxx" is the issue number)You have tested in the following browsers: (Providing a detailed version will be better.)
If adding a new feature, the PR's description includes:
Documentation & Preview
To avoid wasting your time, it's best to open a feature request issue first and wait for approval before working on it.
Other information:
lib
directory.