File tree 2 files changed +50
-38
lines changed 2 files changed +50
-38
lines changed Original file line number Diff line number Diff line change 6
6
< a href ="{{ "/" | relative_url }}"> Liquid</ a >
7
7
{% endif %}
8
8
</ header >
9
- < nav class ="sidebar__nav "> {% assign sections = "basics, tags, filters" | split: ", " %}
10
9
11
- {% for section in sections %}
12
- < h3 class ="section__header "> {{ section | capitalize }}</ h3 >
10
+ {%- assign sections = "basics, tags, filters" | split: ", " -%}
13
11
14
- < ul class ="section__links ">
15
- {% for item in site.pages %}{% if item.url contains section/ %}{% unless item.path contains "index" %}
16
- < li > < a href ="{{ item.url | relative_url }} " class ="section__link{% if item.url contains page.url and page.url != '/' and page.type != 'index' %} section__link--is-active{% endif %} "> {{ item.title }}</ a > </ li >
17
- {% endunless %}{% endif %}{% endfor %}
18
- </ ul >
19
- {% endfor %}
12
+ < nav class ="sidebar__nav ">
13
+ < div class ="sidebar__nav-interior ">
14
+ {%- for section in sections -%}
15
+ < h3 class ="section__header "> {{ section | capitalize }}</ h3 >
20
16
17
+ < ul class ="section__links ">
18
+ {%- for item in site.pages -%}
19
+ {%- if item.url contains section/ -%}
20
+ {%- unless item.path contains "index" -%}
21
+ < li class ="section__item ">
22
+ < a href ="{{ item.url | relative_url }} " class ="section__link {% if item.url contains page.url and page.url != '/' and page.type != 'index' %} section__link--is-active{% endif %} "> {{ item.title }}</ a >
23
+ </ li >
24
+ {%- endunless -%}
25
+ {%- endif -%}
26
+ {%- endfor -%}
27
+ </ ul >
28
+ {%- endfor -%}
29
+ </ div >
21
30
</ nav >
22
- </ div >
31
+ </ div >
Original file line number Diff line number Diff line change 1
-
2
1
$sidebar-width : 250px ;
3
2
$logo-height : 130px ;
4
3
$wrapper-width : 800px ;
@@ -95,34 +94,16 @@ body {
95
94
}
96
95
97
96
.sidebar__nav {
98
- padding : $spacing-unit $spacing-unit ( $spacing-unit + $logo-height ); // Add a bit more padding at the bottom for consistency.
97
+
99
98
font-weight : bold ;
100
99
max-height : 100% ;
101
- overflow-y : scroll ;
102
-
103
- li {
104
- list-style : none ;
105
-
106
- a {
107
- color : $color-white ;
108
-
109
- & :hover {
110
- text-decoration : none ;
111
- }
112
- }
113
- }
100
+ overflow-y : auto ;
114
101
}
115
102
116
- .section {
117
- margin : 0px ;
118
-
119
- > li {
120
- margin-bottom : $spacing-unit / 2 ;
121
-
122
- & :last-child {
123
- margin-bottom : $spacing-unit ;
124
- }
125
- }
103
+ .sidebar__nav-interior {
104
+ height : 100% ;
105
+ // Add a bit more padding at the bottom for consistency.
106
+ padding : $spacing-unit $spacing-unit ($spacing-unit + $logo-height );
126
107
}
127
108
128
109
.section__header {
@@ -131,27 +112,49 @@ body {
131
112
color : $color-white ;
132
113
margin-top : 0 ;
133
114
margin-bottom : $spacing-unit / 4 ;
115
+
116
+ .section__links + & {
117
+ margin-top : $spacing-unit ;
118
+ }
134
119
}
135
120
136
121
.section__links {
137
- margin-left : $spacing-unit / 2 ;
138
- margin-bottom : $spacing-unit ;
139
- font-weight : normal ;
140
122
font-size : 0.9em ;
123
+ font-weight : normal ;
124
+
125
+ list-style : none ;
126
+ margin-left : $spacing-unit / 2 ;
127
+ }
128
+
129
+ .section__item {
130
+ list-style : none ;
141
131
}
142
132
143
133
.section__link {
144
134
display : inline-block ;
145
135
margin-top : $spacing-unit / 4 ;
146
136
opacity : 0.75 ;
147
137
text-decoration : none ;
138
+ color : $color-white ;
148
139
149
140
& :hover {
150
141
opacity : 1 ;
142
+ text-decoration : none ;
143
+ }
144
+
145
+ & :empty {
146
+ // there is an error in the liquid logic that spits out a
147
+ // empty last-child
148
+ display : none ;
149
+ }
150
+
151
+ & :visited {
152
+ color : $color-white ;
151
153
}
152
154
}
153
155
154
156
.section__link--is-active {
155
157
font-weight : bold ;
156
158
opacity : 1 ;
159
+ color : $color-white ;
157
160
}
You can’t perform that action at this time.
0 commit comments