Skip to content

Commit c12a48a

Browse files
committed
Nicer header icon styling
1 parent 5a91429 commit c12a48a

File tree

3 files changed

+22
-44
lines changed

3 files changed

+22
-44
lines changed

src/assets/sass/modules/_layout.scss

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -177,13 +177,13 @@ noscript {
177177

178178
// search input field
179179

180-
input[type="search"] {
180+
[type="search"] {
181181
width: 34px;
182182
height: 34px;
183183
padding-left: 32px;
184184
transition: width 0.2s ease-in-out;
185185
border-color: $color-background;
186-
background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cg fill='%23333'%3E%3Cpath d='M4,13c0-5,4-9,9-9s9,4,9,9s-4,9-9,9S4,18,4,13z M13,19c3.3,0,6-2.7,6-6s-2.7-6-6-6s-6,2.7-6,6S9.7,19,13,19z'/%3E%3Cpath d='M17.5,19l1.5-1.5l4.5,3L28,25c0,0,0,1.5-0.8,2.2S25,28,25,28l-4.5-4.5L17.5,19z'/%3E%3C/g%3E%3C/svg%3E") no-repeat left center;
186+
background: $color-background-form url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cg fill='%23333'%3E%3Cpath d='M4,13c0-5,4-9,9-9s9,4,9,9s-4,9-9,9S4,18,4,13z M13,19c3.3,0,6-2.7,6-6s-2.7-6-6-6s-6,2.7-6,6S9.7,19,13,19z'/%3E%3Cpath d='M17.5,19l1.5-1.5l4.5,3L28,25c0,0,0,1.5-0.8,2.2S25,28,25,28l-4.5-4.5L17.5,19z'/%3E%3C/g%3E%3C/svg%3E") no-repeat left center;
187187
background-size: 32px 32px;
188188

189189
&:focus {
@@ -193,12 +193,14 @@ noscript {
193193
}
194194

195195
@include dark-mode {
196-
.search-form input[type="search"] {
197-
border-color: $dark-color-border-extra-dark;
198-
background: $dark-color-background-form url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cg fill='%23ced4da'%3E%3Cpath d='M4,13c0-5,4-9,9-9s9,4,9,9s-4,9-9,9S4,18,4,13z M13,19c3.3,0,6-2.7,6-6s-2.7-6-6-6s-6,2.7-6,6S9.7,19,13,19z'/%3E%3Cpath d='M17.5,19l1.5-1.5l4.5,3L28,25c0,0,0,1.5-0.8,2.2S25,28,25,28l-4.5-4.5L17.5,19z'/%3E%3C/g%3E%3C/svg%3E") no-repeat left center;
196+
.search-form [type="search"] {
197+
border-color: $dark-color-background;
198+
background-color: $dark-color-background;
199+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cg fill='%23ced4da'%3E%3Cpath d='M4,13c0-5,4-9,9-9s9,4,9,9s-4,9-9,9S4,18,4,13z M13,19c3.3,0,6-2.7,6-6s-2.7-6-6-6s-6,2.7-6,6S9.7,19,13,19z'/%3E%3Cpath d='M17.5,19l1.5-1.5l4.5,3L28,25c0,0,0,1.5-0.8,2.2S25,28,25,28l-4.5-4.5L17.5,19z'/%3E%3C/g%3E%3C/svg%3E");
199200

200201
&:focus {
201202
border-color: $dark-color-link-focus;
203+
background-color: $dark-color-background-form;
202204
}
203205
}
204206
}

src/assets/sass/modules/_navigation.scss

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -163,16 +163,12 @@
163163
display: block;
164164
}
165165

166-
&:hover {
167-
background-color: $color-selected;
168-
}
169-
170166
&.site-navigation-toggle-active {
171-
background-color: $color-strong-highlight-box;
167+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cg fill='%23333'%3E%3Cpath d='m6.1 23.1 17-17 2.8 2.8-17 17z'/%3E%3Cpath d='m8.9 6.1 17 17-2.8 2.8-17-17z'/%3E%3C/g%3E%3C/svg%3E");
172168
}
173169

174-
&:active {
175-
background-color: $color-selecting;
170+
&:hover {
171+
border-color: $color-border-extra-dark;
176172
}
177173

178174
&:focus {
@@ -183,20 +179,15 @@
183179

184180
@include dark-mode {
185181
#site-navigation-toggle {
186-
border-color: $dark-color-border-extra-dark;
187-
background: $dark-color-background-form url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath fill='%23ced4da' d='M4 6h24v4H4zm0 8h24v4H4zm0 8h24v4H4z'/%3E%3C/svg%3E");
182+
border-color: $dark-color-background;
183+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath fill='%23ced4da' d='M4 6h24v4H4zm0 8h24v4H4zm0 8h24v4H4z'/%3E%3C/svg%3E");
188184

189185
&:hover {
190186
border-color: $dark-color-border-extra-light;
191-
background-color: $dark-color-selecting;
192187
}
193188

194189
&.site-navigation-toggle-active {
195-
background-color: $dark-color-strong-highlight-box;
196-
}
197-
198-
&:active {
199-
background-color: $dark-color-selected;
190+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cg fill='%23ced4da'%3E%3Cpath d='m6.1 23.1 17-17 2.8 2.8-17 17z'/%3E%3Cpath d='m8.9 6.1 17 17-2.8 2.8-17-17z'/%3E%3C/g%3E%3C/svg%3E");
200191
}
201192

202193
&:focus {

src/assets/sass/modules/_responsive.scss

Lines changed: 9 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -291,8 +291,14 @@
291291
top: 0.75em;
292292
right: 0;
293293

294-
input[type="search"] {
295-
width: 244px;
294+
[type="search"] {
295+
width: 254px;
296+
}
297+
}
298+
299+
@include dark-mode {
300+
.search-form [type="search"] {
301+
background-color: $dark-color-background-form;
296302
}
297303
}
298304

@@ -452,33 +458,12 @@
452458
padding-right: 0;
453459
cursor: pointer;
454460

455-
&:hover {
456-
background-color: $color-selected;
457-
}
458-
459461
&:focus {
460-
width: 244px;
461-
padding-right: 0.5384615em;
462-
background-color: $color-background-form;
462+
width: 254px;
463463
cursor: auto;
464464
}
465465
}
466466
}
467-
468-
@include dark-mode {
469-
.search-form {
470-
[type="search"] {
471-
&:hover {
472-
border-color: $dark-color-border-extra-light;
473-
background-color: $dark-color-selecting;
474-
}
475-
476-
&:focus {
477-
background-color: $dark-color-background-form;
478-
}
479-
}
480-
}
481-
}
482467
}
483468

484469

0 commit comments

Comments
 (0)