-
Notifications
You must be signed in to change notification settings - Fork 1.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
Improve theme support when JS is disabled #2454
Conversation
c3c6db2
to
edcf05e
Compare
Finally fixed CI. ^^' |
@notriddle Is this something you'd be willing to help review? No worries if not, I don't want to pressure anyone. |
I think it'd be nice for mdBook to get more reviewers, so if needed, don't hesitate to ask me too for other PRs. |
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.
It looks like it's just code cleanup without any user-visible change, but your commit message sounds like it's saying that themes actually work better in noscript.
I don't think this PR allows you to actually switch themes when JS is disabled (I don't know how you'd even do that). It does allow you to see the menu bar, but the theme button isn't there.
The code itself seems okay, other than one question I asked here.
It's now taking into account the system theme, which was not the case until now. So it is an improvement. ;)
It doesn't indeed. |
edcf05e
to
236e976
Compare
Okay. Please say that in the PR description. Instead of just "Little PR to improve theme support when JS is disabled.", I would prefer something like "Little PR to follow the system's light/dark theme when JS is disabled." |
Good idea, done! |
This PR removes some JS (which is why there are more changes, removing all Overall this PR is more complete I'd say. |
@@ -107,7 +104,7 @@ a > .hljs { | |||
overflow: hidden; | |||
text-overflow: ellipsis; | |||
} | |||
.js .menu-title { | |||
.menu-title { | |||
cursor: pointer; |
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.
If I understand it correctly, this change will result in the 👆 cursor being used on the menu title, even when javascript is disabled. I don't think clicking on the title actually does anything when javascript is disabled, so you'd need to do something to prevent that.
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.
Good point. We could emulate the same behaviour (scrolling to the top) without JS by replacing this element with <a href="#">...</a>
. Should I do it in this PR?
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.
I think that should be a separate PR.
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.
👍
236e976
to
31cae14
Compare
Removed the |
31cae14
to
4b5480e
Compare
Applied your suggestions. :) |
4b5480e
to
d93fbc0
Compare
Updated! |
@ehuss PR is now ready. :) |
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!
Little PR to follow the system's light/dark theme when JS is disabled.