Skip to content

Commit 82a7e27

Browse files
author
Florian Kissling
committed
Fix the sidebar layout and its jumpy link hover/active states.
1 parent 60a8772 commit 82a7e27

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

docs/_sass/_sidenav.scss

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,7 @@
33
// Scrollspy and affixed enhanced navigation to
44
// highlight sections and secondary sections of docs content`.
55

6-
// First level of nav
7-
.s2-docs-sidenav {
8-
margin-top: 20px;
9-
margin-bottom: 20px;
10-
6+
.s2-docs-sidebar {
117
// By default it is not affixed in mobile views, so undo that
128
&.affix {
139
position: static;
@@ -18,6 +14,12 @@
1814
}
1915
}
2016

17+
// First level of nav
18+
.s2-docs-sidenav {
19+
margin-top: 20px;
20+
margin-bottom: 20px;
21+
}
22+
2123
// All levels of nav
2224
.s2-docs-sidebar .nav {
2325
> li > a {
@@ -28,7 +30,7 @@
2830
font-weight: 500;
2931
color: #767676;
3032
border-left: 1px solid transparent;
31-
transition: color .2s, border-color .2s, border-width .2s;
33+
transition: color .2s, border-color .2s;
3234
}
3335

3436
> li > a code {
@@ -38,7 +40,6 @@
3840

3941
> li > a:hover,
4042
> li > a:focus {
41-
padding-left: 19px;
4243
color: #428BCA;
4344
text-decoration: none;
4445
background-color: transparent;
@@ -48,7 +49,7 @@
4849
> .active > a,
4950
> .active:hover > a,
5051
> .active:focus > a {
51-
padding-left: 18px;
52+
padding-left: 19px;
5253
font-weight: bold;
5354
color: #428BCA;
5455
background-color: transparent;
@@ -77,7 +78,7 @@
7778
.nav > .active > a,
7879
.nav > .active:hover > a,
7980
.nav > .active:focus > a {
80-
padding-left: 30px;
81+
padding-left: 29px;
8182
font-weight: 400;
8283
}
8384
}
@@ -106,7 +107,6 @@
106107

107108
// Undo the static from mobile first approach
108109
.s2-docs-sidebar.affix {
109-
110110
position: fixed;
111111
top: 0px;
112112
}

0 commit comments

Comments
 (0)