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: Fixing sidebar animation #333

Merged
merged 1 commit into from
May 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added docs/_static/favicon.ico
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
html_title = "Sphinx Book Theme"
html_copy_source = True
html_sourcelink_suffix = ""
html_favicon = "_static/logo.png"
html_favicon = "_static/favicon.ico"
html_last_updated_fmt = ""

html_sidebars = {
Expand Down

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion sphinx_book_theme/theme.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
inherit = pydata_sphinx_theme
pygments_style = tango
sidebars = sidebar-logo.html, search-field.html, sbt-sidebar-nav.html, sbt-sidebar-footer.html
stylesheet = sphinx-book-theme.acff12b8f9c144ce68a297486a2fa670.css
stylesheet = sphinx-book-theme.9359c37b55a5988de97dce26f47073bc.css

[options]
single_page = False
Expand Down
13 changes: 13 additions & 0 deletions src/scss/_leftbar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,19 @@
transition: margin-left .2s ease 0s, opacity .2s ease 0s, visibility .2s ease 0s;
z-index: 2000 !important;

// Over-ride bootstrap collapsing styles for a smooth transition
&.collapse {
visibility: hidden;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You likely don't need this.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just the visibility one?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea, the visibility rules seem unnecessary to me, given that this is gonna be off-canvas anyway.

I might be wrong tho.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ahh I think you're right, but it does have a nice effect as a "fade out" in the animation :-)

margin-left: -$leftbar-width;
opacity: 0;
display: block;
&.show {
visibility: visible;
margin-left: 0;
opacity: 1;
}
}

@include scrollbar-style();
@media (max-width: $breakpoint-md) {
position: fixed;
Expand Down