Skip to content
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

Fix several theme issues #648

Merged
merged 9 commits into from
Apr 9, 2018

Conversation

mattico
Copy link
Contributor

@mattico mattico commented Mar 19, 2018

Fixes #647

See the commit messages.

@Michael-F-Bryan
Copy link
Contributor

Hmm, my concern here is it could be more of a band-aid solution than a real fix. I would have thought it'd be easy enough to use CSS to make sure the search bar doesn't overlap the content.

The root problem seems to be that we're using absolute positioning for the page content (so it'll leave space below the header bar) and that means other things can't flow/reposition themselves around it properly. If that's the case, the proper fix would probably be to remove the absolute positioning and display: block and position the page content differently... Would that work?

@sorin-davidoi, do you know of a way to make sure the search results+bar, page content, and top header bar can be positioned nicely using CSS?

@sorin-davidoi
Copy link
Contributor

Don't think there is a nice way as long as absolute positioning is used.

@Michael-F-Bryan
Copy link
Contributor

Do we need to use absolute positioning in the first place?

@mattico
Copy link
Contributor Author

mattico commented Mar 20, 2018

I agree re: bandaid solutions. This is what, the 3rd PR for a similar issue?

I would have thought it'd be easy enough to use CSS to make sure the search bar doesn't overlap the content.

Possibly. My intent was just to fix the current behavior, but I suppose it'd be nice to show page content under the search.

@mattico mattico force-pushed the fix-search-overlap branch from 0e8e064 to 2d73e2a Compare March 20, 2018 17:11
@mattico
Copy link
Contributor Author

mattico commented Mar 20, 2018

Okay, you nerd-sniped me there :) There were a few small CSS issues that I've wanted to fix, so I fixed them. Before merging, I should go through the git-blame and make sure I'm not regressing anything by removing some CSS hacks. I'll leave that for later though since I've already spent too much time on this for today.

@mattico mattico changed the title Fix showResults Fix several theme issues Mar 20, 2018
@mattico mattico force-pushed the fix-search-overlap branch from 6e7143c to 40974b9 Compare March 21, 2018 15:07
@mattico mattico force-pushed the fix-search-overlap branch from 76c8439 to 00159a3 Compare April 2, 2018 17:29
@mattico
Copy link
Contributor Author

mattico commented Apr 2, 2018

I think this is good to go. I tested it pretty thoroughly in FF, Chrome, Edge, and couldn't get anything to break.

@mattico
Copy link
Contributor Author

mattico commented Apr 3, 2018

Looks like rust 1.25 broke netbsd.... sigh

@mattico
Copy link
Contributor Author

mattico commented Apr 3, 2018

I'm going to see if a hello world fails to build on netbsd, report it upstream, then disable netbsd on travis.

mattico added 9 commits April 7, 2018 13:11
which wasn't completely de-jqueryified.
This reduces jank caused by reflowing the page text while animating the
sidebar, and it looks nicer.
since edge doesn't support it yet
since it's the same color as the background, which isn't animated.
- Remove invalid `pointer: cursor` style
- Disable transitions for noscript to stop page from spazzing on every load
- Add `cursor: pointer` to mark
- Disable `cursor: pointer` on noscript menu-title
- Load MathJax async
- Always use local fontawesome and clipboard.js
- Move js class to html element to make theme switching easier
@mattico mattico force-pushed the fix-search-overlap branch from 9003f7c to f14547d Compare April 7, 2018 18:11
@mattico
Copy link
Contributor Author

mattico commented Apr 8, 2018

There, rebased and working.

@Michael-F-Bryan Michael-F-Bryan merged commit f01bf88 into rust-lang:master Apr 9, 2018
@Michael-F-Bryan
Copy link
Contributor

And merged 🎉

@steveklabnik
Copy link
Member

When is a release going to be made with this in it? It seems like this affects all of the books in the bookshelf 😅

@mattico mattico deleted the fix-search-overlap branch April 9, 2018 16:02
@Michael-F-Bryan
Copy link
Contributor

@steveklabnik I just pushed out a new release. Looking at the example book locally it seems like our previous styling problems are fixed 🤞

@mattico mattico mentioned this pull request Apr 27, 2018
Ruin0x11 pushed a commit to Ruin0x11/mdBook that referenced this pull request Aug 30, 2020
* Don't hide page content when displaying search

* Decrease sidebar animation time

* Fix search key event handler
which wasn't completely de-jqueryified.

* Avoid reflowing page content on small screens
This reduces jank caused by reflowing the page text while animating the
sidebar, and it looks nicer.

* Don't use HTMLParentNode.prepend()
since edge doesn't support it yet

* Don't animate menu border bottom color
since it's the same color as the background, which isn't animated.

* Small CSS improvments
- Remove invalid `pointer: cursor` style
- Disable transitions for noscript to stop page from spazzing on every load
- Add `cursor: pointer` to mark
- Disable `cursor: pointer` on noscript menu-title

* JS fixes

- Load MathJax async
- Always use local fontawesome and clipboard.js
- Move js class to html element to make theme switching easier

* Give the print button a bit more margin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants