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(navbar): fix styles when navbar is not present #316

Merged
merged 1 commit into from
May 2, 2018
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
10 changes: 7 additions & 3 deletions lib/default-theme/styles/mobile.styl
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,13 @@ $mobileSidebarWidth = $sidebarWidth * 0.82
transition transform .2s ease
.page
padding-left 0
.theme-container.sidebar-open
.sidebar
transform translateX(0)
.theme-container
&.sidebar-open
.sidebar
transform translateX(0)
&.no-navbar
.sidebar
padding-top: 0

// narrow mobile
@media (max-width: $MQMobileNarrow)
Expand Down
6 changes: 5 additions & 1 deletion lib/default-theme/styles/theme.styl
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,14 @@ th, td
.sidebar-mask
display: block
&.no-navbar
.content:not(.custom)
.content:not(.custom) >
h1, h2, h3, h4, h5, h6
margin-top 1.5rem
padding-top 0
.sidebar
top 0
Copy link
Member

Choose a reason for hiding this comment

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

Why need reset top: 0 here ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

When there is no navbar, setting top to 0 will cause the sidebar to have 100% height of the viewport on Desktop.

Before

desktop before

After

desktop after

.custom-layout
padding-top 0


@media (min-width: ($MQMobile + 1px))
Expand Down