fix(docs-infra): fix mobile toc styles (#31533)

Return mobile toc styles from bug in PR#31013
Give docs pages header a width limit so it does not run into the Github icon link

PR Close #31533
This commit is contained in:
Stefanie Fluin 2019-07-12 14:12:11 -07:00 committed by Miško Hevery
parent f65db20c6d
commit ebc71f7caa
2 changed files with 153 additions and 149 deletions

View File

@ -7,6 +7,10 @@ body,
background-color: $white; background-color: $white;
} }
.github-links + .content h1 {
max-width: 90%;
}
.clearfix { .clearfix {
content: ""; content: "";
display: table; display: table;

View File

@ -6,183 +6,183 @@
bottom: 12px; bottom: 12px;
overflow-y: auto; overflow-y: auto;
overflow-x: hidden; overflow-x: hidden;
}
.toc-inner { .toc-inner {
@include font-size(13); @include font-size(13);
overflow-y: visible; overflow-y: visible;
padding: 4px 0 0 10px; padding: 4px 0 0 10px;
.toc-heading, .toc-heading,
.toc-list .h1 { .toc-list .h1 {
@include font-size(16); @include font-size(16);
} }
.toc-heading { .toc-heading {
font-weight: 500; font-weight: 500;
margin: 0 0 16px 8px; margin: 0 0 16px 8px;
padding: 0; padding: 0;
&.secondary { &.secondary {
position: relative;
top: -8px;
&:hover {
color: $accentblue;
}
}
}
button.toc-heading,
button.toc-more-items {
cursor: pointer;
display: inline-block;
background: 0;
background-color: transparent;
border: none;
box-shadow: none;
padding: 0;
text-align: start;
&.embedded:focus {
outline: none;
background: $lightgray;
}
}
button.toc-heading {
mat-icon.rotating-icon {
height: 18px;
width: 18px;
position: relative;
left: -4px;
top: 5px;
}
&:hover:not(.embedded) {
color: $accentblue;
}
}
button.toc-more-items {
color: $mediumgray;
top: 10px;
position: relative; position: relative;
top: -8px;
&:hover { &:hover {
color: $accentblue; color: $accentblue;
} }
&::after { }
content: 'expand_less'; }
}
&.collapsed::after { button.toc-heading,
content: 'more_horiz'; button.toc-more-items {
} cursor: pointer;
display: inline-block;
background: 0;
background-color: transparent;
border: none;
box-shadow: none;
padding: 0;
text-align: start;
&.embedded:focus {
outline: none;
background: $lightgray;
}
}
button.toc-heading {
mat-icon.rotating-icon {
height: 18px;
width: 18px;
position: relative;
left: -4px;
top: 5px;
} }
.mat-icon { &:hover:not(.embedded) {
&.collapsed { color: $accentblue;
@include rotate(0deg); }
} }
&:not(.collapsed) { button.toc-more-items {
@include rotate(90deg); color: $mediumgray;
} top: 10px;
position: relative;
&:hover {
color: $accentblue;
} }
ul.toc-list { &::after {
list-style-type: none; content: 'expand_less';
margin: 0; }
padding: 0 8px 0 0;
@media (max-width: 800px) { &.collapsed::after {
width: auto; content: 'more_horiz';
}
}
.mat-icon {
&.collapsed {
@include rotate(0deg);
}
&:not(.collapsed) {
@include rotate(90deg);
}
}
ul.toc-list {
list-style-type: none;
margin: 0;
padding: 0 8px 0 0;
@media (max-width: 800px) {
width: auto;
}
li {
box-sizing: border-box;
@include font-size(12);
@include line-height(16);
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: $lightgray;
clear: both;
} }
li { &.h3 {
box-sizing: border-box; padding-left: 24px;
}
a {
color: lighten($darkgray, 10);
overflow: visible;
@include font-size(12); @include font-size(12);
@include line-height(16); display: table-cell;
padding: 3px 0 3px 12px; }
position: relative;
transition: all 0.3s ease-in-out;
&.h1:after { &:hover {
content: ''; * {
display: block; color: $accentblue;
height: 1px;
width: 40%;
margin: 7px 0 4px 0;
background: $lightgray;
clear: both;
}
&.h3 {
padding-left: 24px;
}
a {
color: lighten($darkgray, 10);
overflow: visible;
@include font-size(12);
display: table-cell;
}
&:hover {
* {
color: $accentblue;
}
}
&.active {
* {
color: $blue;
font-weight: 500;
&:before {
content: '';
border-radius: 50%;
left: -3px;
top: 12px;
background: $blue;
position: absolute;
width: 6px;
height: 6px;
}
}
} }
} }
&:not(.embedded) li { &.active {
&:before { * {
border-left: 1px solid $lightgray; color: $blue;
bottom: 0; font-weight: 500;
content: '';
left: 0;
position: absolute;
top: 0;
}
&:first-child:before { &:before {
top: 13px; content: '';
border-radius: 50%;
left: -3px;
top: 12px;
background: $blue;
position: absolute;
width: 6px;
height: 6px;
}
} }
}
}
&:last-child:before { &:not(.embedded) li {
bottom: calc(100% - 14px); &:before {
} border-left: 1px solid $lightgray;
bottom: 0;
content: '';
left: 0;
position: absolute;
top: 0;
}
&:not(.active):hover a:before { &:first-child:before {
content: ''; top: 13px;
border-radius: 50%; }
left: -3px;
top: 12px; &:last-child:before {
background: $lightgray; bottom: calc(100% - 14px);
position: absolute; }
width: 6px;
height: 6px; &:not(.active):hover a:before {
} content: '';
border-radius: 50%;
left: -3px;
top: 12px;
background: $lightgray;
position: absolute;
width: 6px;
height: 6px;
} }
} }
} }