Skip to content

Commit 106d289

Browse files
authored
feat(lint): adjust templates to match linted FUI code (#215)
This PR reflects the changes of fomantic/Fomantic-UI#2610
1 parent 56cc6d2 commit 106d289

File tree

1 file changed

+94
-92
lines changed

1 file changed

+94
-92
lines changed

src/templates/icon.variables.liquid

Lines changed: 94 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
/*******************************
77

8-
Fomantic-UI integration of FontAwesome :
8+
Fomantic-UI integration of FontAwesome:
99

1010
// class names are separated
1111
i.icon.angle-left => i.icon.angle.left
@@ -31,9 +31,9 @@ Icons are order A-Z in their group, Solid, Outline, Thin (Pro only) and Brand
3131
Icon
3232
*******************************/
3333

34-
/*--------------
34+
/* --------------
3535
Font Files
36-
---------------*/
36+
--------------- */
3737

3838
/* Solid Icons */
3939
@importIcons: true;
@@ -45,158 +45,155 @@ Icons are order A-Z in their group, Solid, Outline, Thin (Pro only) and Brand
4545

4646
@fonts: {
4747
{% if icons.solid.icons.length > 0 -%}
48-
@solid: {
49-
font-family: @fontName;
50-
src: url("@{fontPath}/@{fontName}.woff2") format('woff2')
51-
if(@supportIE, e(',') url("@{fontPath}/@{fontName}.woff") format('woff'));
52-
font-style : normal;
53-
font-weight : @normal;
54-
font-display : block;
55-
font-variant : normal;
56-
text-decoration: inherit;
57-
text-transform : none;
58-
};
48+
@solid: {
49+
font-family: @fontName;
50+
src: url('@{fontPath}/@{fontName}.woff2') format('woff2')
51+
if(@supportIE, e(',') url('@{fontPath}/@{fontName}.woff') format('woff'));
52+
font-style: normal;
53+
font-weight: @normal;
54+
font-display: block;
55+
font-variant: normal;
56+
text-decoration: inherit;
57+
text-transform: none;
58+
};
5959
{%- endif %}
6060
{% if icons.outline.icons.length > 0 -%}
61-
@outline: {
62-
font-family: @outlineFontName;
63-
src: url("@{fontPath}/@{outlineFontName}.woff2") format('woff2')
64-
if(@supportIE, e(',') url("@{fontPath}/@{outlineFontName}.woff") format('woff'));
65-
font-style : normal;
66-
font-weight : @normal;
67-
font-display : block;
68-
font-variant : normal;
69-
text-decoration: inherit;
70-
text-transform : none;
71-
};
61+
@outline: {
62+
font-family: @outlineFontName;
63+
src: url('@{fontPath}/@{outlineFontName}.woff2') format('woff2')
64+
if(@supportIE, e(',') url('@{fontPath}/@{outlineFontName}.woff') format('woff'));
65+
font-style: normal;
66+
font-weight: @normal;
67+
font-display: block;
68+
font-variant: normal;
69+
text-decoration: inherit;
70+
text-transform: none;
71+
};
7272
{%- endif %}
7373
{% if icons.thin.icons.length > 0 -%}
74-
@thin: {
75-
font-family: @thinFontName;
76-
src: url("@{fontPath}/@{thinFontName}.woff2") format('woff2')
77-
if(@supportIE, e(',') url("@{fontPath}/@{thinFontName}.woff") format('woff'));
78-
font-style : normal;
79-
font-weight : @normal;
80-
font-display : block;
81-
font-variant : normal;
82-
text-decoration: inherit;
83-
text-transform : none;
84-
};
74+
@thin: {
75+
font-family: @thinFontName;
76+
src: url('@{fontPath}/@{thinFontName}.woff2') format('woff2')
77+
if(@supportIE, e(',') url('@{fontPath}/@{thinFontName}.woff') format('woff'));
78+
font-style: normal;
79+
font-weight: @normal;
80+
font-display: block;
81+
font-variant: normal;
82+
text-decoration: inherit;
83+
text-transform: none;
84+
};
8585
{%- endif %}
8686
{% if icons.brand.icons.length > 0 -%}
87-
@brand: {
88-
font-family: @brandFontName;
89-
src: url("@{fontPath}/@{brandFontName}.woff2") format('woff2')
90-
if(@supportIE, e(',') url("@{fontPath}/@{brandFontName}.woff") format('woff'));
91-
font-style : normal;
92-
font-weight : @normal;
93-
font-display : block;
94-
font-variant : normal;
95-
text-decoration: inherit;
96-
text-transform : none;
97-
};
87+
@brand: {
88+
font-family: @brandFontName;
89+
src: url('@{fontPath}/@{brandFontName}.woff2') format('woff2')
90+
if(@supportIE, e(',') url('@{fontPath}/@{brandFontName}.woff') format('woff'));
91+
font-style: normal;
92+
font-weight: @normal;
93+
font-display: block;
94+
font-variant: normal;
95+
text-decoration: inherit;
96+
text-transform: none;
97+
};
9898
{%- endif %}
9999
{% if icons.duotone.icons.length > 0 -%}
100-
@duotone: {
101-
font-family: @duotoneFontName;
102-
src: url("@{fontPath}/@{duotoneFontName}.woff2") format('woff2')
103-
if(@supportIE, e(',') url("@{fontPath}/@{duotoneFontName}.woff") format('woff'));
104-
font-style : normal;
105-
font-weight : @normal;
106-
font-display : block;
107-
font-variant : normal;
108-
text-decoration: inherit;
109-
text-transform : none;
110-
};
100+
@duotone: {
101+
font-family: @duotoneFontName;
102+
src: url('@{fontPath}/@{duotoneFontName}.woff2') format('woff2')
103+
if(@supportIE, e(',') url('@{fontPath}/@{duotoneFontName}.woff') format('woff'));
104+
font-style: normal;
105+
font-weight: @normal;
106+
font-display: block;
107+
font-variant: normal;
108+
text-decoration: inherit;
109+
text-transform: none;
110+
};
111111
{%- endif %}
112-
113112
};
114113

115-
116114
// Underscores in map keys will be replaced by dots to separate classnames at compile time
117115

118-
/* Deprecated *In/Out Naming Conflict) */
116+
/* Deprecated (In/Out Naming Conflict) */
119117
@icon-deprecated-map: {
120-
linkedin_in:\f0e1;
121-
zoom_in: \f00e;
122-
zoom_out: \f010;
123-
sign_in: \f2f6;
124-
in_cart: \f218;
125-
log_out: \f2f5;
126-
sign_out: \f2f5;
118+
linkedin_in: '\f0e1';
119+
zoom_in: '\f00e';
120+
zoom_out: '\f010';
121+
sign_in: '\f2f6';
122+
in_cart: '\f218';
123+
log_out: '\f2f5';
124+
sign_out: '\f2f5';
127125
};
128126

129127
/* Icons */
130128
@icon-map: {
131129
{% for icon in icons.solid.icons -%}
132-
{{ icon.className | replace: ".", "_" }}: {{ icon.unicode }};
130+
{{ icon.className | replace: ".", "_" }}: '{{ icon.unicode }}';
133131
{% endfor -%}
134132
};
135133

136134
@icon-aliases-map: {
137135
{% for icon in icons.solid.aliases -%}
138-
{{ icon.className | replace: ".", "_" }}: {{ icon.unicode }};
136+
{{ icon.className | replace: ".", "_" }}: '{{ icon.unicode }}';
139137
{% endfor -%}
140138
};
141139

142140
@icon-outline-map: {
143141
{% for icon in icons.outline.icons -%}
144-
{{ icon.className | replace: ".", "_" }}: {{ icon.unicode }};
142+
{{ icon.className | replace: ".", "_" }}: '{{ icon.unicode }}';
145143
{% endfor -%}
146144
};
147145
@icon-outline-aliases-map: {
148146
{% for icon in icons.outline.aliases -%}
149-
{{ icon.className | replace: ".", "_" }}: {{ icon.unicode }};
147+
{{ icon.className | replace: ".", "_" }}: '{{ icon.unicode }}';
150148
{% endfor -%}
151149
};
152150

153151
@icon-thin-map: {
154152
{% for icon in icons.thin.icons -%}
155-
{{ icon.className | replace: ".", "_" }}: {{ icon.unicode }};
153+
{{ icon.className | replace: ".", "_" }}: '{{ icon.unicode }}';
156154
{% endfor -%}
157155
};
158156
@icon-thin-aliases-map: {
159157
{% for icon in icons.thin.aliases -%}
160-
{{ icon.className | replace: ".", "_" }}: {{ icon.unicode }};
158+
{{ icon.className | replace: ".", "_" }}: '{{ icon.unicode }}';
161159
{% endfor -%}
162160
};
163161

164162
@icon-brand-map: {
165163
{% for icon in icons.brand.icons -%}
166-
{{ icon.className | replace: ".", "_" }}: {{ icon.unicode }};
164+
{{ icon.className | replace: ".", "_" }}: '{{ icon.unicode }}';
167165
{% endfor -%}
168166
};
169167
@icon-brand-aliases-map: {
170168
{% for icon in icons.brand.aliases -%}
171-
{{ icon.className | replace: ".", "_" }}: {{ icon.unicode }};
169+
{{ icon.className | replace: ".", "_" }}: '{{ icon.unicode }}';
172170
{% endfor -%}
173171
};
174172

175173
@icon-duotone-map: {
176174
{% for icon in icons.duotone.icons -%}
177-
{{ icon.className | replace: ".", "_" }}: {{ icon.unicode }};
175+
{{ icon.className | replace: ".", "_" }}: '{{ icon.unicode }}';
178176
{% endfor -%}
179177
};
180178
@icon-duotone-secondary-map: {
181179
{% for icon in icons.duotone.icons -%}
182-
{{ icon.className | replace: ".", "_" }}: {{ icon.secondaryUnicode }};
180+
{{ icon.className | replace: ".", "_" }}: '{{ icon.secondaryUnicode }}';
183181
{% endfor -%}
184182
};
185183
@icon-duotone-aliases-map: {
186184
{% for icon in icons.duotone.aliases -%}
187-
{{ icon.className | replace: ".", "_" }}: {{ icon.unicode }};
185+
{{ icon.className | replace: ".", "_" }}: '{{ icon.unicode }}';
188186
{% endfor -%}
189187
};
190188
@icon-duotone-secondary-aliases-map: {
191189
{% for icon in icons.duotone.aliases -%}
192-
{{ icon.className | replace: ".", "_" }}: {{ icon.secondaryUnicode }};
190+
{{ icon.className | replace: ".", "_" }}: '{{ icon.secondaryUnicode }}';
193191
{% endfor -%}
194192
};
195193

196-
197-
/*--------------
194+
/* --------------
198195
Definition
199-
---------------*/
196+
--------------- */
200197

201198
/* Icon Variables */
202199
@opacity: 1;
@@ -205,7 +202,6 @@ Icons are order A-Z in their group, Solid, Outline, Thin (Pro only) and Brand
205202
@distanceFromText: 0.25rem;
206203
@lineHeight: 1;
207204

208-
209205
/* Variations */
210206
@linkOpacity: 0.8;
211207
@linkDuration: 0.3s;
@@ -225,16 +221,16 @@ Icons are order A-Z in their group, Solid, Outline, Thin (Pro only) and Brand
225221
@cornerIconSize: 0.45em;
226222
@cornerIconStroke: 1px;
227223
@cornerIconShadow:
228-
-@cornerIconStroke -@cornerIconStroke 0 @white,
229-
@cornerIconStroke -@cornerIconStroke 0 @white,
230-
-@cornerIconStroke @cornerIconStroke 0 @white,
231-
@cornerIconStroke @cornerIconStroke 0 @white
224+
-@cornerIconStroke -@cornerIconStroke 0 @white,
225+
@cornerIconStroke -@cornerIconStroke 0 @white,
226+
-@cornerIconStroke @cornerIconStroke 0 @white,
227+
@cornerIconStroke @cornerIconStroke 0 @white
232228
;
233229
@cornerIconInvertedShadow:
234-
-@cornerIconStroke -@cornerIconStroke 0 @black,
235-
@cornerIconStroke -@cornerIconStroke 0 @black,
236-
-@cornerIconStroke @cornerIconStroke 0 @black,
237-
@cornerIconStroke @cornerIconStroke 0 @black
230+
-@cornerIconStroke -@cornerIconStroke 0 @black,
231+
@cornerIconStroke -@cornerIconStroke 0 @black,
232+
-@cornerIconStroke @cornerIconStroke 0 @black,
233+
@cornerIconStroke @cornerIconStroke 0 @black
238234
;
239235

240236
@cornerOffset: 0;
@@ -248,3 +244,9 @@ Icons are order A-Z in their group, Solid, Outline, Thin (Pro only) and Brand
248244
@big: 2em;
249245
@huge: 4em;
250246
@massive: 8em;
247+
248+
/* Duotone specifics */
249+
@duotonePrimaryColor: inherit;
250+
@duotonePrimaryOpacity: 1;
251+
@duotoneSecondaryColor: inherit;
252+
@duotoneSecondaryOpacity: 0.4;

0 commit comments

Comments
 (0)