Skip to content

Commit 080e9aa

Browse files
committed
fix #370 by moving icon placeholder to a mixin
1 parent 1359a72 commit 080e9aa

10 files changed

+35
-63
lines changed

client/styles/abstracts/_mixins.scss

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,24 @@
1616
$theme-map: null !global;
1717
}
1818
}
19+
}
20+
21+
@mixin icon() {
22+
@include themify() {
23+
color: getThemifyVariable('icon-color');
24+
& g {
25+
fill: getThemifyVariable('icon-color');
26+
}
27+
&:hover {
28+
color: getThemifyVariable('icon-hover-color');
29+
& g {
30+
opacity: 1;
31+
fill: getThemifyVariable('icon-hover-color');
32+
}
33+
}
34+
}
35+
background-color: transparent;
36+
border: none;
37+
cursor: pointer;
38+
padding: 0;
1939
}

client/styles/abstracts/_placeholders.scss

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -31,26 +31,6 @@
3131
}
3232
}
3333

34-
%icon {
35-
@include themify() {
36-
color: getThemifyVariable('icon-color');
37-
& g {
38-
fill: getThemifyVariable('icon-color');
39-
}
40-
&:hover {
41-
color: getThemifyVariable('icon-hover-color');
42-
& g {
43-
opacity: 1;
44-
fill: getThemifyVariable('icon-hover-color');
45-
}
46-
}
47-
}
48-
background-color: transparent;
49-
border: none;
50-
cursor: pointer;
51-
padding: 0;
52-
}
53-
5434
%icon-toast{
5535
@include themify() {
5636
color: $toast-text-color

client/styles/components/_about.scss

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,7 @@
2525
}
2626

2727
.about__exit-button {
28-
@include themify() {
29-
@extend %icon;
30-
}
28+
@include icon();
3129
}
3230

3331
.about__logo {

client/styles/components/_console.scss

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,19 +72,15 @@
7272

7373
.preview-console__collapse {
7474
padding-top: #{3 / $base-font-size}rem;
75-
@include themify() {
76-
@extend %icon;
77-
}
75+
@include icon();
7876
.preview-console--collapsed & {
7977
display: none;
8078
}
8179
}
8280

8381
.preview-console__expand {
8482
padding-top: #{3 / $base-font-size}rem;
85-
@include themify() {
86-
@extend %icon;
87-
}
83+
@include icon();
8884
display: none;
8985
.preview-console--collapsed & {
9086
display: inline-block;

client/styles/components/_editor.scss

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -187,9 +187,7 @@
187187
width: 14px;
188188
height: 14px;
189189

190-
@include themify() {
191-
@extend %icon;
192-
}
190+
@include icon();
193191

194192
background-repeat: no-repeat;
195193
background-position: center;
@@ -231,9 +229,7 @@
231229

232230
margin-left: #{8 / $base-font-size}rem;
233231

234-
@include themify() {
235-
@extend %icon;
236-
}
232+
@include icon();
237233

238234
background: transparent url(../images/exit.svg) no-repeat;
239235
}
@@ -249,9 +245,7 @@
249245
}
250246

251247
.editor__options-button {
252-
@include themify() {
253-
@extend %icon;
254-
}
248+
@include icon();
255249
position: absolute;
256250
top: #{10 / $base-font-size}rem;
257251
right: #{2 / $base-font-size}rem;

client/styles/components/_error-modal.scss

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@
1212
}
1313

1414
.error-modal__exit-button {
15-
@include themify() {
16-
@extend %icon;
17-
}
15+
@include icon();
1816
}
1917

2018
.error-modal__content {

client/styles/components/_modal.scss

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@
2222
}
2323

2424
.modal__exit-button {
25-
@include themify() {
26-
@extend %icon;
27-
}
25+
@include icon();
2826
}
2927

3028
.modal__header {
@@ -96,9 +94,7 @@
9694
}
9795

9896
.keyboard-shortcuts__close {
99-
@include themify() {
100-
@extend %icon;
101-
}
97+
@include icon();
10298
}
10399

104100
.keyboard-shortcut-item {

client/styles/components/_preferences.scss

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@
1717
}
1818

1919
.preferences__exit-button {
20-
@include themify() {
21-
@extend %icon;
22-
}
20+
@include icon();
2321
padding-top: #{5 / $base-font-size}rem;
2422
margin-right: #{-6 / $base-font-size}rem;
2523
}

client/styles/components/_sidebar.scss

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,7 @@
2525
}
2626

2727
.sidebar__add {
28-
@include themify() {
29-
@extend %icon;
30-
}
28+
@include icon();
3129
.sidebar--contracted & {
3230
display: none;
3331
}
@@ -124,8 +122,8 @@
124122
}
125123

126124
.sidebar__file-item-show-options {
125+
@include icon();
127126
@include themify() {
128-
@extend %icon;
129127
padding: #{4 / $base-font-size}rem 0;
130128
background-color: map-get($theme-map, 'file-selected-color');
131129
padding-right: #{6 / $base-font-size}rem;
@@ -183,9 +181,7 @@
183181
}
184182

185183
.sidebar__expand {
186-
@include themify() {
187-
@extend %icon;
188-
}
184+
@include icon();
189185
position: absolute;
190186
top: #{7 / $base-font-size}rem;
191187
left: #{1 / $base-font-size}rem;
@@ -200,9 +196,7 @@
200196
}
201197

202198
.sidebar__contract {
203-
@include themify() {
204-
@extend %icon;
205-
}
199+
@include icon();
206200
position: absolute;
207201
top: #{7 / $base-font-size}rem;
208202
left: #{34 / $base-font-size}rem;

client/styles/components/_sketch-list.scss

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,7 @@
6868
}
6969

7070
.sketch-list__exit-button {
71-
@include themify() {
72-
@extend %icon;
73-
}
71+
@include icon();
7472
margin: #{12 / $base-font-size}rem #{16 / $base-font-size}rem;
7573
}
7674

0 commit comments

Comments
 (0)