Skip to content

Commit

Permalink
fix: fix scrollbar issue for #12
Browse files Browse the repository at this point in the history
  • Loading branch information
phodal committed Apr 4, 2020
1 parent 9e2c8c7 commit 4be1f76
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 26 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<div class="normal-echarts chart" #chart>
<div class="chart" #chart>

</div>
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
<div *ngIf="showToc">
<mat-drawer-container class="markdown-toc">
<mat-drawer mode="side" opened class="left-drawer">
<div class="markdown-toc">
<div class="left-drawer">
<ul class="toc" #toc [class.sticky]="sticky"></ul>
</mat-drawer>
<mat-drawer-content class="right-content" #drawerContent>
</div>
<div class="right-content">
<ledge-render [content]="data" *ngIf="data" (scroll)="handleScroll()"></ledge-render>

</mat-drawer-content>
</mat-drawer-container>
</div>
</div>
</div>

<div *ngIf="!showToc" class="no-toc-markdown">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
:host {
position: relative;
box-sizing: border-box;
}

.markdown-toc {
display: flex;
flex-direction: row;
width: 100%;
overflow-y: scroll;

.left-drawer {
width: 15%;
min-width: 120px;
min-height: 100vh;
width: 20%;
min-width: 160px;
height: calc(100vh - 66px);
}

.right-content {
width: 100%;
}
}

Expand All @@ -20,9 +27,10 @@

.sticky {
position: fixed;
overflow: scroll;
overflow-y: scroll;
z-index: 10;
height: calc(100vh - 66px);
top: 0;
height: 100vh;
}

.scroll-to-top {
Expand Down
16 changes: 3 additions & 13 deletions src/styles/_markdown.scss
Original file line number Diff line number Diff line change
Expand Up @@ -591,6 +591,7 @@
pre {
margin: 1em 0 !important;
padding: 0 4px !important;

code {
padding: 0;
font-size: 0.8em;
Expand All @@ -611,8 +612,10 @@
margin-right: 0;
}
}

li {
list-style: none;

a {
color: #000;

Expand Down Expand Up @@ -648,16 +651,3 @@
}
}

.normal-echarts {
width: 600px;
height: 400px;
}

.toolset-placeholder {
width: auto;
display: block;
height: auto;
border-radius: 4px;
border: 2px solid #ff4081;
margin: 2.5em auto;
}

0 comments on commit 4be1f76

Please sign in to comment.