fix(aio): fix ToC styling

- Make the left bar gray (instead of blue).
- Show gray dot when hovering over an element.
- Hide left bar and dots in embedded mode.
This commit is contained in:
Georgios Kalpakas 2017-05-31 18:57:26 +03:00 committed by Pete Bacon Darwin
parent 819514aeba
commit f2d810febc
2 changed files with 54 additions and 42 deletions

View File

@ -13,7 +13,7 @@
<md-icon class="rotating-icon" svgIcon="keyboard_arrow_right" [class.collapsed]="isCollapsed"></md-icon> <md-icon class="rotating-icon" svgIcon="keyboard_arrow_right" [class.collapsed]="isCollapsed"></md-icon>
</button> </button>
<ul class="toc-list"> <ul class="toc-list" [class.embedded]="type !== 'Floating'">
<ng-container *ngFor="let toc of tocList; let i = index"> <ng-container *ngFor="let toc of tocList; let i = index">
<li #tocItem title="{{toc.title}}" *ngIf="type === 'Floating' || toc.level !== 'h1'" <li #tocItem title="{{toc.title}}" *ngIf="type === 'Floating' || toc.level !== 'h1'"
class="{{toc.level}}" [class.secondary]="type === 'EmbeddedExpandable' && i >= primaryMax" [class.active]="i === activeIndex"> class="{{toc.level}}" [class.secondary]="type === 'EmbeddedExpandable' && i >= primaryMax" [class.active]="i === activeIndex">

View File

@ -109,59 +109,71 @@ aio-toc {
width: auto; width: auto;
} }
} li {
box-sizing: border-box;
ul.toc-list li {
box-sizing: border-box;
font-size: 12px;
line-height: 16px;
padding: 3px 0 3px 12px;
position: relative;
transition: all 0.3s ease-in-out;
&.h1:after {
content: '';
display: block;
height: 1px;
width: 40%;
margin: 7px 0 4px 0;
background: #DBDBDB;
clear: both;
}
&.h1, &.h2, &.h3 {
border-left: 1px solid $blue;
}
&.h3 {
padding-left: 24px;
}
a {
font-size: inherit;
color: lighten($darkgray, 10);
display:table-cell;
overflow: visible;
font-size: 12px; font-size: 12px;
display: table-cell; line-height: 16px;
padding: 3px 0 3px 12px;
position: relative;
transition: all 0.3s ease-in-out;
&:hover { &.h1:after {
content: '';
display: block;
height: 1px;
width: 40%;
margin: 7px 0 4px 0;
background: #DBDBDB;
clear: both;
}
&.h3 {
padding-left: 24px;
}
a {
font-size: inherit;
color: lighten($darkgray, 10);
display:table-cell;
overflow: visible;
font-size: 12px;
display: table-cell;
}
&:hover a {
color: $accentblue; color: $accentblue;
} }
&.active {
a {
color: $blue;
font-weight: 500;
}
&:before {
content: '';
border-radius: 50%;
left: -4px;
top: 12px;
background: $blue;
position: absolute;
width: 6px;
height: 6px;
}
}
} }
&.active { &:not(.embedded) li {
a { &.h1, &.h2, &.h3 {
color: $blue; border-left: 1px solid $lightgray;
font-weight: 500;
} }
&:before { &:not(.active):hover:before {
content: ''; content: '';
border-radius: 50%; border-radius: 50%;
left: -4px; left: -4px;
top: 12px; top: 12px;
background: $blue; background: $lightgray;
position: absolute; position: absolute;
width: 6px; width: 6px;
height: 6px; height: 6px;