feat(aio): toc styling

- TOC styling
- TOC container placeholder
This commit is contained in:
Stefanie Fluin 2017-05-02 10:13:10 -07:00 committed by Matias Niemelä
parent 55b8de9fdd
commit 77b8a76f2e
4 changed files with 72 additions and 23 deletions

View File

@ -32,6 +32,9 @@
</md-sidenav-container> </md-sidenav-container>
<div *ngIf="isSideBySide" class="toc-container"></div>
<footer> <footer>
<aio-footer [nodes]="footerNodes" [versionInfo]="versionInfo" ></aio-footer> <aio-footer [nodes]="footerNodes" [versionInfo]="versionInfo" ></aio-footer>
</footer> </footer>

View File

@ -4,10 +4,7 @@
(click)="toggle()" (click)="toggle()"
title="Expand/collapse contents" title="Expand/collapse contents"
aria-label="Expand/collapse contents"> aria-label="Expand/collapse contents">
Contents <p>Table of Contents<button type="button" class="toc-show-all material-icons" [class.closed]="isClosed"></button></p>
<button type="button"
class="toc-show-all material-icons" [class.closed]="isClosed">
</button>
</div> </div>
<ul class="toc-list"> <ul class="toc-list">

View File

@ -31,16 +31,15 @@ md-sidenav.mat-sidenav.sidenav {
md-sidenav-container.sidenav-container { md-sidenav-container.sidenav-container {
min-height: 100%; min-height: 100%;
height: auto !important; height: auto !important;
max-width: 1400px; max-width: 82%;
margin: 0; margin: 0;
transform: none; transform: none;
padding-top: 64px; padding-top: 64px;
}
// md-sidenav.sidenav.mat-sidenav.mat-sidenav-side.mat-sidenav-opened { @media (max-width: 800px) {
// position: fixed; max-width: 100%;
// padding-top: 72px; }
// } }
md-sidenav-container div.mat-sidenav-content { md-sidenav-container div.mat-sidenav-content {
height: auto; height: auto;

View File

@ -1,14 +1,27 @@
.toc-container {
width: 18%;
position: fixed;
top: 84px;
right: 0;
bottom: 18px;
overflow-y: auto;
overflow-x: hidden;
@media (max-width: 800px) {
display: none;
width: 0;
}
}
aio-toc > div { aio-toc > div {
font-size: 13px; font-size: 13px;
border-left: 10px solid #4285f4;
overflow-y: visible; overflow-y: visible;
padding: 4px 0 0 10px; padding: 4px 0 0 10px;
.toc-heading { .toc-heading p {
font-size: 22px;
font-weight: 500; font-weight: 500;
margin-left: 8px; margin: 0 0 0 -11px;
padding-bottom: 8px; padding: 0;
} }
.toc-heading.secondary { .toc-heading.secondary {
@ -24,7 +37,6 @@ aio-toc > div {
button.toc-show-all, button.toc-show-all,
button.toc-more-items { button.toc-more-items {
display: inline-block; display: inline-block;
position: relative;
background: 0; background: 0;
background-color: transparent; background-color: transparent;
border: none; border: none;
@ -42,6 +54,8 @@ aio-toc > div {
button.toc-show-all { button.toc-show-all {
min-width: 34px; min-width: 34px;
position: absolute;
top: 0;
} }
button.toc-show-all::after { button.toc-show-all::after {
@ -54,6 +68,7 @@ aio-toc > div {
button.toc-more-items { button.toc-more-items {
top: 10px; top: 10px;
position: relative;
} }
button.toc-more-items::after { button.toc-more-items::after {
@ -68,22 +83,57 @@ aio-toc > div {
list-style-type: none; list-style-type: none;
margin: 0; margin: 0;
padding: 0 8px; padding: 0 8px;
@media (max-width: 800px) {
width: auto;
}
} }
ul.toc-list li { ul.toc-list li {
font-size: 12px;
line-height: 16px; line-height: 16px;
margin: 0; margin: 6px 0;
padding: 0 16px;
position: relative;
transition: all 0.3 ease-in-out;
&:before {
content: '';
border-radius: 50%;
left: -3px;
top: 10px;
background: $lightgray;
position: absolute;
width: 6px;
height: 6px;
}
&:last-child a:before {
width: 0;
}
a { a {
color: $mediumgray; font-size: 12px;
display:inline-block; color: lighten($darkgray, 10);
display:table-cell;
overflow: visible; overflow: visible;
&:hover { &:hover {
color: $accentblue; color: $accentblue;
} }
}
&:before {
content: '';
left: -1px;
top: 10px;
background: $lightgray;
position: absolute;
display: block;
width: 1px;
height: calc(100% + 11px);
}
}
} }
ul.toc-list li.h3 { ul.toc-list li.h3 {