Skip to content

Commit

Permalink
fix: fix margin issue
Browse files Browse the repository at this point in the history
  • Loading branch information
phodal committed Apr 3, 2020
1 parent 2dd2837 commit d7f2481
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,19 @@
}

.markdown-toc {
min-height: 600px;
height: calc(100vh - 66px);
overflow-y: hidden;

.left-drawer {
width: 15%;
min-width: 120px;
position: absolute;
}

.right-content {
height: calc(100vh - 68px);
}
}

.no-toc-markdown {
width: 95%;
margin: 1em auto 0;
height: calc(100vh - 66px);
}

.sticky {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,14 @@ export class MarkdownRenderComponent
top = this.drawerEl.elementRef.nativeElement.scrollTop;
}

const windowScroll = window.pageYOffset;
const headerHeight = 64;
if (windowScroll >= headerHeight) {
this.sticky = true;
} else {
this.sticky = false;
}

if (
window.pageYOffset ||
document.documentElement.scrollTop ||
Expand Down
1 change: 0 additions & 1 deletion src/app/shared/ledge-render/ledge-render.component.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
.ledge-render {
width: 100%;
height: 100vh;
}

.render-item {
Expand Down
2 changes: 0 additions & 2 deletions src/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ html {
}

body {
max-width: 100%;
max-height: 100%;
min-width: 1200px;
width: auto;
}
Expand Down
1 change: 0 additions & 1 deletion src/styles/_markdown.scss
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,6 @@

.markdown-toc {
font-size: 18px;
padding-top: 1em;

.left-drawer {
font-size: 16px;
Expand Down

0 comments on commit d7f2481

Please sign in to comment.