@roblexperu/style 1.0.59 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +21 -0
- package/.husky/pre-commit +4 -0
- package/CLAUDE.md +52 -0
- package/README.md +123 -0
- package/fonts-icons.js +17 -4
- package/package.json +14 -11
- package/scripts/version-update.js +93 -80
- package/test/js/fonts-icons.test.js +53 -0
- package/test/js/version-update.test.js +49 -0
- package/test/sass/flexbox.test.js +4 -0
- package/test/sass/flexbox.test.scss +479 -0
- package/test/sass/fonts.test.js +4 -0
- package/test/sass/fonts.test.scss +243 -0
- package/test/sass/media.test.js +4 -0
- package/test/sass/media.test.scss +103 -0
- package/.huskyrc.js +0 -6
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
@import '../../node_modules/sass-true/sass/true';
|
|
2
|
+
@import '../../src/vars/breakpoint';
|
|
3
|
+
@import '../../src/mixins/media';
|
|
4
|
+
@import '../../src/mixins/fonts';
|
|
5
|
+
|
|
6
|
+
@include describe('font-face mixin') {
|
|
7
|
+
@include it('emits a single @font-face rule with an EOT primary src and a full-format src fallback list') {
|
|
8
|
+
@include assert {
|
|
9
|
+
@include output {
|
|
10
|
+
@include font-face('https://cdn.example.com', 'Maax-Bold', 'Maax', 'Maax-Bold');
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
@include expect {
|
|
14
|
+
@font-face {
|
|
15
|
+
font-family: "Maax-Bold";
|
|
16
|
+
src: url("https://cdn.example.com/fonts/Maax/Maax-Bold.eot");
|
|
17
|
+
src: url("https://cdn.example.com/fonts/Maax/Maax-Bold.eot?#iefix") format("embedded-opentype"), url("https://cdn.example.com/fonts/Maax/Maax-Bold.svg") format("svg"), url("https://cdn.example.com/fonts/Maax/Maax-Bold.ttf") format("truetype"), url("https://cdn.example.com/fonts/Maax/Maax-Bold.woff") format("woff"), url("https://cdn.example.com/fonts/Maax/Maax-Bold.woff2") format("woff2");
|
|
18
|
+
font-weight: normal;
|
|
19
|
+
font-style: normal;
|
|
20
|
+
font-display: swap;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
@include it('accepts a custom weight and style') {
|
|
27
|
+
@include assert {
|
|
28
|
+
@include output {
|
|
29
|
+
@include font-face('https://cdn.example.com', 'Maax-Bold', 'Maax', 'Maax-Bold', bold, italic);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
@include expect {
|
|
33
|
+
@font-face {
|
|
34
|
+
font-family: "Maax-Bold";
|
|
35
|
+
src: url("https://cdn.example.com/fonts/Maax/Maax-Bold.eot");
|
|
36
|
+
src: url("https://cdn.example.com/fonts/Maax/Maax-Bold.eot?#iefix") format("embedded-opentype"), url("https://cdn.example.com/fonts/Maax/Maax-Bold.svg") format("svg"), url("https://cdn.example.com/fonts/Maax/Maax-Bold.ttf") format("truetype"), url("https://cdn.example.com/fonts/Maax/Maax-Bold.woff") format("woff"), url("https://cdn.example.com/fonts/Maax/Maax-Bold.woff2") format("woff2");
|
|
37
|
+
font-weight: bold;
|
|
38
|
+
font-style: italic;
|
|
39
|
+
font-display: swap;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
@include describe('font-face-for-fonts mixin') {
|
|
47
|
+
$test-fonts: (
|
|
48
|
+
Maax: (),
|
|
49
|
+
Maax-Bold: (
|
|
50
|
+
name: 'Maax Bold Family',
|
|
51
|
+
weight: bold,
|
|
52
|
+
style: italic
|
|
53
|
+
)
|
|
54
|
+
);
|
|
55
|
+
|
|
56
|
+
@include it('emits one @font-face per font, defaulting the family name to the map key and weight/style to normal') {
|
|
57
|
+
@include assert {
|
|
58
|
+
@include output {
|
|
59
|
+
@include font-face-for-fonts('/assets', 'Maax', $test-fonts);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
@include expect {
|
|
63
|
+
@font-face {
|
|
64
|
+
font-family: "Maax";
|
|
65
|
+
src: url("/assets/fonts/Maax/Maax.eot");
|
|
66
|
+
src: url("/assets/fonts/Maax/Maax.eot?#iefix") format("embedded-opentype"), url("/assets/fonts/Maax/Maax.svg") format("svg"), url("/assets/fonts/Maax/Maax.ttf") format("truetype"), url("/assets/fonts/Maax/Maax.woff") format("woff"), url("/assets/fonts/Maax/Maax.woff2") format("woff2");
|
|
67
|
+
font-weight: normal;
|
|
68
|
+
font-style: normal;
|
|
69
|
+
font-display: swap;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
@font-face {
|
|
73
|
+
font-family: "Maax Bold Family";
|
|
74
|
+
src: url("/assets/fonts/Maax/Maax-Bold.eot");
|
|
75
|
+
src: url("/assets/fonts/Maax/Maax-Bold.eot?#iefix") format("embedded-opentype"), url("/assets/fonts/Maax/Maax-Bold.svg") format("svg"), url("/assets/fonts/Maax/Maax-Bold.ttf") format("truetype"), url("/assets/fonts/Maax/Maax-Bold.woff") format("woff"), url("/assets/fonts/Maax/Maax-Bold.woff2") format("woff2");
|
|
76
|
+
font-weight: bold;
|
|
77
|
+
font-style: italic;
|
|
78
|
+
font-display: swap;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
@include describe('font-family-size mixin') {
|
|
86
|
+
$size: (
|
|
87
|
+
size: 18px
|
|
88
|
+
);
|
|
89
|
+
|
|
90
|
+
@include it('builds an unprefixed class selector from font-name, description, and size-attribute') {
|
|
91
|
+
@include assert {
|
|
92
|
+
@include output {
|
|
93
|
+
@include font-family-size('Publica Sans Round', 'Bold', $size, 'publica-sans-round', 'bold', 'text-sm', bold);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
@include expect {
|
|
97
|
+
.publica-sans-round-bold-text-sm {
|
|
98
|
+
font-family: "Publica Sans Round";
|
|
99
|
+
font-size: 18px;
|
|
100
|
+
font-weight: bold;
|
|
101
|
+
font-style: normal;
|
|
102
|
+
line-height: normal;
|
|
103
|
+
letter-spacing: normal;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
@include it('prefixes the class with the breakpoint and appends the type suffix to font-size when given') {
|
|
110
|
+
@include assert {
|
|
111
|
+
@include output {
|
|
112
|
+
@include font-family-size('Publica Sans Round', 'Bold', $size, 'publica-sans-round', 'bold', 'text-sm', bold, normal, 'xs', !important);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
@include expect {
|
|
116
|
+
.xs-publica-sans-round-bold-text-sm {
|
|
117
|
+
font-family: "Publica Sans Round";
|
|
118
|
+
font-size: 18px !important;
|
|
119
|
+
font-weight: bold;
|
|
120
|
+
font-style: normal;
|
|
121
|
+
line-height: normal;
|
|
122
|
+
letter-spacing: normal;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
@include it('reads line-height and letter-spacing from the size map when present') {
|
|
129
|
+
$size-with-metrics: (
|
|
130
|
+
size: 18px,
|
|
131
|
+
line: 24px,
|
|
132
|
+
spacing: 0.5px
|
|
133
|
+
);
|
|
134
|
+
|
|
135
|
+
@include assert {
|
|
136
|
+
@include output {
|
|
137
|
+
@include font-family-size('Publica Sans Round', 'Bold', $size-with-metrics, 'publica-sans-round', 'bold', 'text-sm', bold);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
@include expect {
|
|
141
|
+
.publica-sans-round-bold-text-sm {
|
|
142
|
+
font-family: "Publica Sans Round";
|
|
143
|
+
font-size: 18px;
|
|
144
|
+
font-weight: bold;
|
|
145
|
+
font-style: normal;
|
|
146
|
+
line-height: 24px;
|
|
147
|
+
letter-spacing: 0.5px;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
@include describe('font-sizing mixin') {
|
|
155
|
+
$test-fonts: (
|
|
156
|
+
Bold: (
|
|
157
|
+
name: 'Publica Sans Round',
|
|
158
|
+
description: 'bold',
|
|
159
|
+
weight: bold,
|
|
160
|
+
style: normal
|
|
161
|
+
)
|
|
162
|
+
);
|
|
163
|
+
|
|
164
|
+
$test-sizing: (
|
|
165
|
+
text-sm: (
|
|
166
|
+
size: 18px
|
|
167
|
+
)
|
|
168
|
+
);
|
|
169
|
+
|
|
170
|
+
@include it('emits an unprefixed class plus a breakpoint-prefixed !important variant for every registered breakpoint') {
|
|
171
|
+
@include assert {
|
|
172
|
+
@include output {
|
|
173
|
+
@include font-sizing('publica-sans-round', $test-sizing, $test-fonts);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
@include expect {
|
|
177
|
+
.publica-sans-round-bold-text-sm {
|
|
178
|
+
font-family: "Publica Sans Round";
|
|
179
|
+
font-size: 18px;
|
|
180
|
+
font-weight: bold;
|
|
181
|
+
font-style: normal;
|
|
182
|
+
line-height: normal;
|
|
183
|
+
letter-spacing: normal;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
@media only screen and (max-width: 480px) {
|
|
187
|
+
.xs-publica-sans-round-bold-text-sm {
|
|
188
|
+
font-family: "Publica Sans Round";
|
|
189
|
+
font-size: 18px !important;
|
|
190
|
+
font-weight: bold;
|
|
191
|
+
font-style: normal;
|
|
192
|
+
line-height: normal;
|
|
193
|
+
letter-spacing: normal;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
@media only screen and (max-width: 776px) {
|
|
198
|
+
.sm-publica-sans-round-bold-text-sm {
|
|
199
|
+
font-family: "Publica Sans Round";
|
|
200
|
+
font-size: 18px !important;
|
|
201
|
+
font-weight: bold;
|
|
202
|
+
font-style: normal;
|
|
203
|
+
line-height: normal;
|
|
204
|
+
letter-spacing: normal;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
@media only screen and (max-width: 768px) {
|
|
209
|
+
.md-publica-sans-round-bold-text-sm {
|
|
210
|
+
font-family: "Publica Sans Round";
|
|
211
|
+
font-size: 18px !important;
|
|
212
|
+
font-weight: bold;
|
|
213
|
+
font-style: normal;
|
|
214
|
+
line-height: normal;
|
|
215
|
+
letter-spacing: normal;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
@media only screen and (max-width: 992px) {
|
|
220
|
+
.lg-publica-sans-round-bold-text-sm {
|
|
221
|
+
font-family: "Publica Sans Round";
|
|
222
|
+
font-size: 18px !important;
|
|
223
|
+
font-weight: bold;
|
|
224
|
+
font-style: normal;
|
|
225
|
+
line-height: normal;
|
|
226
|
+
letter-spacing: normal;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
@media only screen and (max-width: 1300px) {
|
|
231
|
+
.xl-publica-sans-round-bold-text-sm {
|
|
232
|
+
font-family: "Publica Sans Round";
|
|
233
|
+
font-size: 18px !important;
|
|
234
|
+
font-weight: bold;
|
|
235
|
+
font-style: normal;
|
|
236
|
+
line-height: normal;
|
|
237
|
+
letter-spacing: normal;
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
@import '../../node_modules/sass-true/sass/true';
|
|
2
|
+
@import '../../src/vars/breakpoint';
|
|
3
|
+
@import '../../src/mixins/media';
|
|
4
|
+
|
|
5
|
+
@include describe('breakpoint mixins') {
|
|
6
|
+
@include it('xs wraps content in a max-width media query using $xs') {
|
|
7
|
+
@include assert {
|
|
8
|
+
@include output {
|
|
9
|
+
@include xs {
|
|
10
|
+
color: red;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
@include expect {
|
|
15
|
+
@media only screen and (max-width: 480px) {
|
|
16
|
+
color: red;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
@include it('sm wraps content in a max-width media query using $sm') {
|
|
23
|
+
@include assert {
|
|
24
|
+
@include output {
|
|
25
|
+
@include sm {
|
|
26
|
+
color: red;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
@include expect {
|
|
31
|
+
@media only screen and (max-width: 776px) {
|
|
32
|
+
color: red;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
@include it('md wraps content in a max-width media query using $md') {
|
|
39
|
+
@include assert {
|
|
40
|
+
@include output {
|
|
41
|
+
@include md {
|
|
42
|
+
color: red;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
@include expect {
|
|
47
|
+
@media only screen and (max-width: 768px) {
|
|
48
|
+
color: red;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
@include it('lg wraps content in a max-width media query using $lg') {
|
|
55
|
+
@include assert {
|
|
56
|
+
@include output {
|
|
57
|
+
@include lg {
|
|
58
|
+
color: red;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
@include expect {
|
|
63
|
+
@media only screen and (max-width: 992px) {
|
|
64
|
+
color: red;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
@include it('xl wraps content in a max-width media query using $xl') {
|
|
71
|
+
@include assert {
|
|
72
|
+
@include output {
|
|
73
|
+
@include xl {
|
|
74
|
+
color: red;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
@include expect {
|
|
79
|
+
@media only screen and (max-width: 1300px) {
|
|
80
|
+
color: red;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
@include describe('media-breakpoint mixin') {
|
|
88
|
+
@include it('wraps content in a max-width media query using the given value') {
|
|
89
|
+
@include assert {
|
|
90
|
+
@include output {
|
|
91
|
+
@include media-breakpoint(600px) {
|
|
92
|
+
color: blue;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
@include expect {
|
|
97
|
+
@media only screen and (max-width: 600px) {
|
|
98
|
+
color: blue;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|