unit.gl 0.1.11 → 0.1.13
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/README.md +2 -2
- package/css/unit.gl.css +26 -91
- package/css/unit.gl.min.css +1 -1
- package/js/GridManager.js +6 -2
- package/js/GridManager.js.map +1 -1
- package/js/unit.gl.js +4 -2
- package/js/unit.gl.js.map +1 -1
- package/package.json +1 -1
- package/scss/_reset.scss +2 -0
- package/scss/classes/_ratio.scss +14 -14
- package/scss/mixins/_device.scss +2 -0
- package/scss/mixins/_display.scss +1 -0
- package/scss/mixins/_ratio.scss +25 -19
- package/scss/mixins/_unit.scss +10 -5
- package/scss/tags/_index.scss +2 -0
- package/scss/tags/_unit.scss +2 -0
- package/scss/variables/_color.scss +2 -0
- package/scss/variables/_index.scss +5 -0
- package/scss/variables/_scale.scss +2 -0
- package/scss/variables/_unit.scss +6 -6
- package/scss/variables/_view.scss +4 -1
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<p align="center">
|
|
2
|
-
<img src="https://raw.githubusercontent.com/stylescape/brand/master/src/logo/logo-transparant.png" width="20%"
|
|
2
|
+
<img src="https://raw.githubusercontent.com/stylescape/brand/master/src/logo/logo-transparant.png" width="20%" alt="Stylescape Logo">
|
|
3
3
|
</p>
|
|
4
4
|
<h1 align="center" style='border-bottom: none;'>unit.gl</h1>
|
|
5
5
|
<h3 align="center">Dynamic Layout Engine</h3>
|
|
@@ -78,7 +78,7 @@ Please refer to the [contribution guidelines](.github/CONTRIBUTING.md) for infor
|
|
|
78
78
|
|
|
79
79
|
#### Copyright
|
|
80
80
|
|
|
81
|
-
Copyright ©
|
|
81
|
+
Copyright © 2025 [Scape Agency BV](https://www.scape.agency/ "Scape Agency website"). All Rights Reserved.
|
|
82
82
|
|
|
83
83
|
#### License
|
|
84
84
|
|
package/css/unit.gl.css
CHANGED
|
@@ -148,17 +148,12 @@ main {
|
|
|
148
148
|
display: block;
|
|
149
149
|
}
|
|
150
150
|
|
|
151
|
-
.
|
|
151
|
+
.aspect_ratio--1x1 {
|
|
152
152
|
position: relative;
|
|
153
153
|
width: 100%;
|
|
154
154
|
aspect-ratio: 1;
|
|
155
155
|
}
|
|
156
|
-
.
|
|
157
|
-
content: "";
|
|
158
|
-
display: block;
|
|
159
|
-
padding-top: calc(1 / 1 * 100%);
|
|
160
|
-
}
|
|
161
|
-
.ratio_1x1 > * {
|
|
156
|
+
.aspect_ratio--1x1 > * {
|
|
162
157
|
position: absolute;
|
|
163
158
|
top: 0;
|
|
164
159
|
right: 0;
|
|
@@ -168,17 +163,12 @@ main {
|
|
|
168
163
|
height: 100%;
|
|
169
164
|
}
|
|
170
165
|
|
|
171
|
-
.
|
|
166
|
+
.aspect_ratio--1x2 {
|
|
172
167
|
position: relative;
|
|
173
168
|
width: 100%;
|
|
174
169
|
aspect-ratio: 0.5;
|
|
175
170
|
}
|
|
176
|
-
.
|
|
177
|
-
content: "";
|
|
178
|
-
display: block;
|
|
179
|
-
padding-top: calc(2 / 1 * 100%);
|
|
180
|
-
}
|
|
181
|
-
.ratio_1x2 > * {
|
|
171
|
+
.aspect_ratio--1x2 > * {
|
|
182
172
|
position: absolute;
|
|
183
173
|
top: 0;
|
|
184
174
|
right: 0;
|
|
@@ -188,17 +178,12 @@ main {
|
|
|
188
178
|
height: 100%;
|
|
189
179
|
}
|
|
190
180
|
|
|
191
|
-
.
|
|
181
|
+
.aspect_ratio--2x1 {
|
|
192
182
|
position: relative;
|
|
193
183
|
width: 100%;
|
|
194
184
|
aspect-ratio: 2;
|
|
195
185
|
}
|
|
196
|
-
.
|
|
197
|
-
content: "";
|
|
198
|
-
display: block;
|
|
199
|
-
padding-top: calc(1 / 2 * 100%);
|
|
200
|
-
}
|
|
201
|
-
.ratio_2x1 > * {
|
|
186
|
+
.aspect_ratio--2x1 > * {
|
|
202
187
|
position: absolute;
|
|
203
188
|
top: 0;
|
|
204
189
|
right: 0;
|
|
@@ -208,17 +193,12 @@ main {
|
|
|
208
193
|
height: 100%;
|
|
209
194
|
}
|
|
210
195
|
|
|
211
|
-
.
|
|
196
|
+
.aspect_ratio--1x3 {
|
|
212
197
|
position: relative;
|
|
213
198
|
width: 100%;
|
|
214
199
|
aspect-ratio: 0.3333333333;
|
|
215
200
|
}
|
|
216
|
-
.
|
|
217
|
-
content: "";
|
|
218
|
-
display: block;
|
|
219
|
-
padding-top: calc(3 / 1 * 100%);
|
|
220
|
-
}
|
|
221
|
-
.ratio_1x3 > * {
|
|
201
|
+
.aspect_ratio--1x3 > * {
|
|
222
202
|
position: absolute;
|
|
223
203
|
top: 0;
|
|
224
204
|
right: 0;
|
|
@@ -228,17 +208,12 @@ main {
|
|
|
228
208
|
height: 100%;
|
|
229
209
|
}
|
|
230
210
|
|
|
231
|
-
.
|
|
211
|
+
.aspect_ratio--3x1 {
|
|
232
212
|
position: relative;
|
|
233
213
|
width: 100%;
|
|
234
214
|
aspect-ratio: 3;
|
|
235
215
|
}
|
|
236
|
-
.
|
|
237
|
-
content: "";
|
|
238
|
-
display: block;
|
|
239
|
-
padding-top: calc(1 / 3 * 100%);
|
|
240
|
-
}
|
|
241
|
-
.ratio_3x1 > * {
|
|
216
|
+
.aspect_ratio--3x1 > * {
|
|
242
217
|
position: absolute;
|
|
243
218
|
top: 0;
|
|
244
219
|
right: 0;
|
|
@@ -248,17 +223,12 @@ main {
|
|
|
248
223
|
height: 100%;
|
|
249
224
|
}
|
|
250
225
|
|
|
251
|
-
.
|
|
226
|
+
.aspect_ratio--1x4 {
|
|
252
227
|
position: relative;
|
|
253
228
|
width: 100%;
|
|
254
229
|
aspect-ratio: 0.25;
|
|
255
230
|
}
|
|
256
|
-
.
|
|
257
|
-
content: "";
|
|
258
|
-
display: block;
|
|
259
|
-
padding-top: calc(4 / 1 * 100%);
|
|
260
|
-
}
|
|
261
|
-
.ratio_1x4 > * {
|
|
231
|
+
.aspect_ratio--1x4 > * {
|
|
262
232
|
position: absolute;
|
|
263
233
|
top: 0;
|
|
264
234
|
right: 0;
|
|
@@ -268,17 +238,12 @@ main {
|
|
|
268
238
|
height: 100%;
|
|
269
239
|
}
|
|
270
240
|
|
|
271
|
-
.
|
|
241
|
+
.aspect_ratio--4x1 {
|
|
272
242
|
position: relative;
|
|
273
243
|
width: 100%;
|
|
274
244
|
aspect-ratio: 4;
|
|
275
245
|
}
|
|
276
|
-
.
|
|
277
|
-
content: "";
|
|
278
|
-
display: block;
|
|
279
|
-
padding-top: calc(1 / 4 * 100%);
|
|
280
|
-
}
|
|
281
|
-
.ratio_4x1 > * {
|
|
246
|
+
.aspect_ratio--4x1 > * {
|
|
282
247
|
position: absolute;
|
|
283
248
|
top: 0;
|
|
284
249
|
right: 0;
|
|
@@ -288,17 +253,12 @@ main {
|
|
|
288
253
|
height: 100%;
|
|
289
254
|
}
|
|
290
255
|
|
|
291
|
-
.
|
|
256
|
+
.aspect_ratio--3x2 {
|
|
292
257
|
position: relative;
|
|
293
258
|
width: 100%;
|
|
294
259
|
aspect-ratio: 1.5;
|
|
295
260
|
}
|
|
296
|
-
.
|
|
297
|
-
content: "";
|
|
298
|
-
display: block;
|
|
299
|
-
padding-top: calc(2 / 3 * 100%);
|
|
300
|
-
}
|
|
301
|
-
.ratio_3x2 > * {
|
|
261
|
+
.aspect_ratio--3x2 > * {
|
|
302
262
|
position: absolute;
|
|
303
263
|
top: 0;
|
|
304
264
|
right: 0;
|
|
@@ -308,17 +268,12 @@ main {
|
|
|
308
268
|
height: 100%;
|
|
309
269
|
}
|
|
310
270
|
|
|
311
|
-
.
|
|
271
|
+
.aspect_ratio--2x3 {
|
|
312
272
|
position: relative;
|
|
313
273
|
width: 100%;
|
|
314
274
|
aspect-ratio: 0.6666666667;
|
|
315
275
|
}
|
|
316
|
-
.
|
|
317
|
-
content: "";
|
|
318
|
-
display: block;
|
|
319
|
-
padding-top: calc(3 / 2 * 100%);
|
|
320
|
-
}
|
|
321
|
-
.ratio_2x3 > * {
|
|
276
|
+
.aspect_ratio--2x3 > * {
|
|
322
277
|
position: absolute;
|
|
323
278
|
top: 0;
|
|
324
279
|
right: 0;
|
|
@@ -328,17 +283,12 @@ main {
|
|
|
328
283
|
height: 100%;
|
|
329
284
|
}
|
|
330
285
|
|
|
331
|
-
.
|
|
286
|
+
.aspect_ratio--4x3 {
|
|
332
287
|
position: relative;
|
|
333
288
|
width: 100%;
|
|
334
289
|
aspect-ratio: 1.3333333333;
|
|
335
290
|
}
|
|
336
|
-
.
|
|
337
|
-
content: "";
|
|
338
|
-
display: block;
|
|
339
|
-
padding-top: calc(3 / 4 * 100%);
|
|
340
|
-
}
|
|
341
|
-
.ratio_4x3 > * {
|
|
291
|
+
.aspect_ratio--4x3 > * {
|
|
342
292
|
position: absolute;
|
|
343
293
|
top: 0;
|
|
344
294
|
right: 0;
|
|
@@ -348,17 +298,12 @@ main {
|
|
|
348
298
|
height: 100%;
|
|
349
299
|
}
|
|
350
300
|
|
|
351
|
-
.
|
|
301
|
+
.aspect_ratio--3x4 {
|
|
352
302
|
position: relative;
|
|
353
303
|
width: 100%;
|
|
354
304
|
aspect-ratio: 0.75;
|
|
355
305
|
}
|
|
356
|
-
.
|
|
357
|
-
content: "";
|
|
358
|
-
display: block;
|
|
359
|
-
padding-top: calc(4 / 3 * 100%);
|
|
360
|
-
}
|
|
361
|
-
.ratio_3x4 > * {
|
|
306
|
+
.aspect_ratio--3x4 > * {
|
|
362
307
|
position: absolute;
|
|
363
308
|
top: 0;
|
|
364
309
|
right: 0;
|
|
@@ -368,17 +313,12 @@ main {
|
|
|
368
313
|
height: 100%;
|
|
369
314
|
}
|
|
370
315
|
|
|
371
|
-
.
|
|
316
|
+
.aspect_ratio--16x9 {
|
|
372
317
|
position: relative;
|
|
373
318
|
width: 100%;
|
|
374
319
|
aspect-ratio: 1.7777777778;
|
|
375
320
|
}
|
|
376
|
-
.
|
|
377
|
-
content: "";
|
|
378
|
-
display: block;
|
|
379
|
-
padding-top: calc(9 / 16 * 100%);
|
|
380
|
-
}
|
|
381
|
-
.ratio_16x9 > * {
|
|
321
|
+
.aspect_ratio--16x9 > * {
|
|
382
322
|
position: absolute;
|
|
383
323
|
top: 0;
|
|
384
324
|
right: 0;
|
|
@@ -388,17 +328,12 @@ main {
|
|
|
388
328
|
height: 100%;
|
|
389
329
|
}
|
|
390
330
|
|
|
391
|
-
.
|
|
331
|
+
.aspect_ratio--16x10 {
|
|
392
332
|
position: relative;
|
|
393
333
|
width: 100%;
|
|
394
334
|
aspect-ratio: 1.6;
|
|
395
335
|
}
|
|
396
|
-
.
|
|
397
|
-
content: "";
|
|
398
|
-
display: block;
|
|
399
|
-
padding-top: calc(10 / 16 * 100%);
|
|
400
|
-
}
|
|
401
|
-
.ratio_16x10 > * {
|
|
336
|
+
.aspect_ratio--16x10 > * {
|
|
402
337
|
position: absolute;
|
|
403
338
|
top: 0;
|
|
404
339
|
right: 0;
|
package/css/unit.gl.min.css
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
*,a,abbr,acronym,address,applet,area,article,aside,audio,b,base,basefont,bb,bdo,big,blockquote,body,br,button,canvas,caption,center,cite,code,col,colgroup,command,datalist,dd,del,details,dfn,dialog,dir,div,dl,dt,em,embed,eventsource,fieldset,figcaption,figure,font,footer,form,frame,frameset,h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,i,iframe,img,input,ins,isindex,kbd,keygen,label,legend,li,link,map,mark,menu,meta,meter,nav,noframes,noscript,object,ol,optgroup,option,output,p,param,pre,progress,q,rp,rt,ruby,s,samp,script,section,select,small,source,span,strike,strong,style,sub,sup,table,tbody,td,textarea,tfoot,th,thead,time,title,tr,track,tt,u,ul,var,video,wbr{border:0;font-size:100%;font:inherit;margin:0;margin-block-end:0;margin-block-start:0;margin-inline-end:0;margin-inline-start:0;padding:0;vertical-align:baseline}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section{display:block}.
|
|
1
|
+
*,a,abbr,acronym,address,applet,area,article,aside,audio,b,base,basefont,bb,bdo,big,blockquote,body,br,button,canvas,caption,center,cite,code,col,colgroup,command,datalist,dd,del,details,dfn,dialog,dir,div,dl,dt,em,embed,eventsource,fieldset,figcaption,figure,font,footer,form,frame,frameset,h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,i,iframe,img,input,ins,isindex,kbd,keygen,label,legend,li,link,map,mark,menu,meta,meter,nav,noframes,noscript,object,ol,optgroup,option,output,p,param,pre,progress,q,rp,rt,ruby,s,samp,script,section,select,small,source,span,strike,strong,style,sub,sup,table,tbody,td,textarea,tfoot,th,thead,time,title,tr,track,tt,u,ul,var,video,wbr{border:0;font-size:100%;font:inherit;margin:0;margin-block-end:0;margin-block-start:0;margin-inline-end:0;margin-inline-start:0;padding:0;vertical-align:baseline}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section{display:block}.aspect_ratio--1x1{aspect-ratio:1;position:relative;width:100%}.aspect_ratio--1x1>*{bottom:0;height:100%;left:0;position:absolute;right:0;top:0;width:100%}.aspect_ratio--1x2{aspect-ratio:.5;position:relative;width:100%}.aspect_ratio--1x2>*{bottom:0;height:100%;left:0;position:absolute;right:0;top:0;width:100%}.aspect_ratio--2x1{aspect-ratio:2;position:relative;width:100%}.aspect_ratio--2x1>*{bottom:0;height:100%;left:0;position:absolute;right:0;top:0;width:100%}.aspect_ratio--1x3{aspect-ratio:.3333333333;position:relative;width:100%}.aspect_ratio--1x3>*{bottom:0;height:100%;left:0;position:absolute;right:0;top:0;width:100%}.aspect_ratio--3x1{aspect-ratio:3;position:relative;width:100%}.aspect_ratio--3x1>*{bottom:0;height:100%;left:0;position:absolute;right:0;top:0;width:100%}.aspect_ratio--1x4{aspect-ratio:.25;position:relative;width:100%}.aspect_ratio--1x4>*{bottom:0;height:100%;left:0;position:absolute;right:0;top:0;width:100%}.aspect_ratio--4x1{aspect-ratio:4;position:relative;width:100%}.aspect_ratio--4x1>*{bottom:0;height:100%;left:0;position:absolute;right:0;top:0;width:100%}.aspect_ratio--3x2{aspect-ratio:1.5;position:relative;width:100%}.aspect_ratio--3x2>*{bottom:0;height:100%;left:0;position:absolute;right:0;top:0;width:100%}.aspect_ratio--2x3{aspect-ratio:.6666666667;position:relative;width:100%}.aspect_ratio--2x3>*{bottom:0;height:100%;left:0;position:absolute;right:0;top:0;width:100%}.aspect_ratio--4x3{aspect-ratio:1.3333333333;position:relative;width:100%}.aspect_ratio--4x3>*{bottom:0;height:100%;left:0;position:absolute;right:0;top:0;width:100%}.aspect_ratio--3x4{aspect-ratio:.75;position:relative;width:100%}.aspect_ratio--3x4>*{bottom:0;height:100%;left:0;position:absolute;right:0;top:0;width:100%}.aspect_ratio--16x9{aspect-ratio:1.7777777778;position:relative;width:100%}.aspect_ratio--16x9>*{bottom:0;height:100%;left:0;position:absolute;right:0;top:0;width:100%}.aspect_ratio--16x10{aspect-ratio:1.6;position:relative;width:100%}.aspect_ratio--16x10>*{bottom:0;right:0}.aspect_ratio--16x10>*,.guide{height:100%;left:0;position:absolute;top:0;width:100%}.guide{background-attachment:local;margin:0;opacity:1}.guide,.guide--layer{min-height:100vh;pointer-events:none;z-index:9999}.guide--layer{display:none;left:0;position:absolute;top:0;width:100%}.guide--layer.active{display:block!important}.guide--graph,.guide--graph_centered{background-attachment:local;background-image:repeating-linear-gradient(90deg,hsla(188,6%,46%,.483) 0,hsla(188,6%,46%,.483) 1px,transparent 0,transparent 1.25rem),repeating-linear-gradient(180deg,hsla(188,6%,46%,.483) 0,hsla(188,6%,46%,.483) 1px,transparent 0,transparent 1.25rem);background-repeat:repeat;background-size:1.25rem 1.25rem;height:100%;left:0;margin:0;min-height:100vh;opacity:1;pointer-events:none;position:absolute;top:0;width:100%;z-index:9999}.guide--graph_centered{background-position:calc(50% - 7.5rem) 0}.guide--baseline{background-attachment:local;background-image:repeating-linear-gradient(180deg,#00c8ff 0 1px,transparent 1px 100%);background-repeat:repeat;background-size:100% 1.25rem;height:100%;left:0;margin:0;min-height:100vh;opacity:1;pointer-events:none;position:absolute;top:0;width:100%;z-index:9999}html{font-size:12px}@media screen and (min-width:320px){html{font-size:calc(8.57143px + 1.07143vw)}}@media screen and (min-width:1440px){html{font-size:24px}}html{box-sizing:border-box;-webkit-text-size-adjust:100%;height:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;word-break:normal}body{height:100vh;margin:0;min-height:100%;position:absolute;width:100vw}body,html{height:100%;margin:0}*,:after,:before{background-repeat:no-repeat;box-sizing:inherit}:after,:before{text-decoration:inherit;vertical-align:inherit}*{margin:0;padding:0}
|
|
2
2
|
/*# sourceMappingURL=to.css.map */
|
package/js/GridManager.js
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GridManager = void 0;
|
|
4
|
+
class GridManager {
|
|
2
5
|
constructor() {
|
|
3
6
|
this.STORAGE_KEY = 'unitgl:grid:visibility';
|
|
4
7
|
this.visibilityMap = {};
|
|
@@ -10,7 +13,7 @@ export class GridManager {
|
|
|
10
13
|
try {
|
|
11
14
|
this.visibilityMap = JSON.parse(localStorage.getItem(this.STORAGE_KEY) || '{}');
|
|
12
15
|
}
|
|
13
|
-
catch
|
|
16
|
+
catch {
|
|
14
17
|
this.visibilityMap = {};
|
|
15
18
|
}
|
|
16
19
|
}
|
|
@@ -60,4 +63,5 @@ export class GridManager {
|
|
|
60
63
|
});
|
|
61
64
|
}
|
|
62
65
|
}
|
|
66
|
+
exports.GridManager = GridManager;
|
|
63
67
|
//# sourceMappingURL=GridManager.js.map
|
package/js/GridManager.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GridManager.js","sourceRoot":"","sources":["../../src/ts/GridManager.ts"],"names":[],"mappings":"AAGA,
|
|
1
|
+
{"version":3,"file":"GridManager.js","sourceRoot":"","sources":["../../src/ts/GridManager.ts"],"names":[],"mappings":";;;AAGA,MAAa,WAAW;IAItB;QAHiB,gBAAW,GAAG,wBAAwB,C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AC5B,IAAI,CAAC,kBAAkB,EAAE,CAAC;YAE1B,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,oBAAoB,EAAE,CAAC,CAAC;YACrE,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,oBAAoB,EAAE,CAAC,CAAC;QACvE,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AA3ED,kCA2EC"}
|
package/js/unit.gl.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const GridManager_js_1 = require("./GridManager.js");
|
|
4
|
+
new GridManager_js_1.GridManager();
|
|
3
5
|
document.addEventListener('DOMContentLoaded', () => {
|
|
4
6
|
console.log('[unit.gl] Test site initialized');
|
|
5
7
|
const current = location.pathname.split('/').pop();
|
package/js/unit.gl.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ts/index.ts"],"names":[],"mappings":"AAEA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ts/index.ts"],"names":[],"mappings":";;AAEA,qDAA+C;AAE/C,IAAI,4BAAW,EAAE,CAAC;AAElB,QAAQ,CAAC,gBAAgB,CAAC,kBAAkB,EAAE,GAAG,EAAE;IACjD,OAAO,CAAC,GAAG,CAAC,iCAAiC,CAAC,CAAC;IAG/C,MAAM,OAAO,GAAG,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC;IACnD,MAAM,UAAU,GAAG,QAAQ,CAAC,aAAa,CAAC,YAAY,OAAO,IAAI,CAAC,CAAC;IACnE,IAAI,UAAU,EAAE,CAAC;QACf,UAAU,CAAC,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IACrC,CAAC;AAGH,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
package/scss/_reset.scss
CHANGED
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
///
|
|
13
13
|
////
|
|
14
14
|
|
|
15
|
+
|
|
15
16
|
// ============================================================================
|
|
16
17
|
// Use
|
|
17
18
|
// ============================================================================
|
|
@@ -30,6 +31,7 @@
|
|
|
30
31
|
vertical-align: baseline; // Aligns elements to the baseline to avoid layout shifts
|
|
31
32
|
}
|
|
32
33
|
|
|
34
|
+
|
|
33
35
|
// Apply the reset mixin to all elements
|
|
34
36
|
*,
|
|
35
37
|
a,
|
package/scss/classes/_ratio.scss
CHANGED
|
@@ -32,47 +32,47 @@
|
|
|
32
32
|
// ============================================================================
|
|
33
33
|
|
|
34
34
|
@each $name, $ratio in maps.$ratio_map {
|
|
35
|
-
.
|
|
35
|
+
.aspect_ratio--#{$name} {
|
|
36
36
|
@include mixins.aspect_ratio(list.nth($ratio, 1), list.nth($ratio, 2));
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
// .ratio_1x1 {
|
|
41
|
-
// @include
|
|
41
|
+
// @include aspect_ratio--1x1;
|
|
42
42
|
// }
|
|
43
43
|
// .ratio_1x2 {
|
|
44
|
-
// @include
|
|
44
|
+
// @include aspect_ratio--1x2;
|
|
45
45
|
// }
|
|
46
46
|
// .ratio_2x1 {
|
|
47
|
-
// @include
|
|
47
|
+
// @include aspect_ratio--2x1;
|
|
48
48
|
// }
|
|
49
49
|
// .ratio_1x3 {
|
|
50
|
-
// @include
|
|
50
|
+
// @include aspect_ratio--1x3;
|
|
51
51
|
// }
|
|
52
52
|
// .ratio_3x1 {
|
|
53
|
-
// @include
|
|
53
|
+
// @include aspect_ratio--3x1;
|
|
54
54
|
// }
|
|
55
55
|
// .ratio_1x4 {
|
|
56
|
-
// @include
|
|
56
|
+
// @include aspect_ratio--1x4;
|
|
57
57
|
// }
|
|
58
58
|
// .ratio_4x1 {
|
|
59
|
-
// @include
|
|
59
|
+
// @include aspect_ratio--4x1;
|
|
60
60
|
// }
|
|
61
61
|
// .ratio_3x2 {
|
|
62
|
-
// @include
|
|
62
|
+
// @include aspect_ratio--3x2;
|
|
63
63
|
// }
|
|
64
64
|
// .ratio_2x3 {
|
|
65
|
-
// @include
|
|
65
|
+
// @include aspect_ratio--2x3;
|
|
66
66
|
// }
|
|
67
67
|
// .ratio_4x3 {
|
|
68
|
-
// @include
|
|
68
|
+
// @include aspect_ratio--4x3;
|
|
69
69
|
// }
|
|
70
70
|
// .ratio_3x4 {
|
|
71
|
-
// @include
|
|
71
|
+
// @include aspect_ratio--3x4;
|
|
72
72
|
// }
|
|
73
73
|
// .ratio_16x9 {
|
|
74
|
-
// @include
|
|
74
|
+
// @include aspect_ratio--16x9;
|
|
75
75
|
// }
|
|
76
76
|
// .ratio_16x10 {
|
|
77
|
-
// @include
|
|
77
|
+
// @include aspect_ratio--16x10;
|
|
78
78
|
// }
|
package/scss/mixins/_device.scss
CHANGED
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
///
|
|
20
20
|
////
|
|
21
21
|
|
|
22
|
+
|
|
22
23
|
// ============================================================================
|
|
23
24
|
// Use
|
|
24
25
|
// ============================================================================
|
|
@@ -27,6 +28,7 @@
|
|
|
27
28
|
@use "../variables" as *;
|
|
28
29
|
@use "../maps" as *;
|
|
29
30
|
|
|
31
|
+
|
|
30
32
|
// ============================================================================
|
|
31
33
|
// Mixins
|
|
32
34
|
// ============================================================================
|
package/scss/mixins/_ratio.scss
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
/// using `padding-top` for broader browser compatibility.
|
|
9
9
|
///
|
|
10
10
|
/// Built from a shared `$ratio-map`, this module auto-generates both semantic
|
|
11
|
-
/// mixins (e.g. `
|
|
11
|
+
/// mixins (e.g. `aspect_ratio--16x9`) and utility classes (e.g. `.ratio_16x9`).
|
|
12
12
|
///
|
|
13
13
|
/// @file _ratio.scss
|
|
14
14
|
/// @title Ratio Mixins Module
|
|
@@ -63,11 +63,11 @@
|
|
|
63
63
|
aspect-ratio: math.div($width, $height); // Native CSS support
|
|
64
64
|
|
|
65
65
|
// Fallback for legacy browsers
|
|
66
|
-
&::before {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
}
|
|
66
|
+
// &::before {
|
|
67
|
+
// content: "";
|
|
68
|
+
// display: block;
|
|
69
|
+
// padding-top: calc((#{$height} / #{$width}) * 100%);
|
|
70
|
+
// }
|
|
71
71
|
|
|
72
72
|
> * {
|
|
73
73
|
position: absolute;
|
|
@@ -84,42 +84,48 @@
|
|
|
84
84
|
// Semantic Mixins
|
|
85
85
|
// ============================================================================
|
|
86
86
|
|
|
87
|
-
@mixin
|
|
87
|
+
@mixin aspect_ratio--1x1 {
|
|
88
88
|
@include aspect_ratio(1, 1);
|
|
89
89
|
}
|
|
90
|
-
@mixin
|
|
90
|
+
@mixin aspect_ratio--1x2 {
|
|
91
91
|
@include aspect_ratio(1, 2);
|
|
92
92
|
}
|
|
93
|
-
@mixin
|
|
93
|
+
@mixin aspect_ratio--2x1 {
|
|
94
94
|
@include aspect_ratio(2, 1);
|
|
95
95
|
}
|
|
96
|
-
@mixin
|
|
96
|
+
@mixin aspect_ratio--1x3 {
|
|
97
97
|
@include aspect_ratio(1, 3);
|
|
98
98
|
}
|
|
99
|
-
@mixin
|
|
99
|
+
@mixin aspect_ratio--3x1 {
|
|
100
100
|
@include aspect_ratio(3, 1);
|
|
101
101
|
}
|
|
102
|
-
@mixin
|
|
102
|
+
@mixin aspect_ratio--1x4 {
|
|
103
103
|
@include aspect_ratio(1, 4);
|
|
104
104
|
}
|
|
105
|
-
@mixin
|
|
105
|
+
@mixin aspect_ratio--4x1 {
|
|
106
106
|
@include aspect_ratio(4, 1);
|
|
107
107
|
}
|
|
108
|
-
@mixin
|
|
108
|
+
@mixin aspect_ratio--3x2 {
|
|
109
109
|
@include aspect_ratio(3, 2);
|
|
110
110
|
}
|
|
111
|
-
@mixin
|
|
111
|
+
@mixin aspect_ratio--2x3 {
|
|
112
112
|
@include aspect_ratio(2, 3);
|
|
113
113
|
}
|
|
114
|
-
@mixin
|
|
114
|
+
@mixin aspect_ratio--4x3 {
|
|
115
115
|
@include aspect_ratio(4, 3);
|
|
116
116
|
}
|
|
117
|
-
@mixin
|
|
117
|
+
@mixin aspect_ratio--3x4 {
|
|
118
118
|
@include aspect_ratio(3, 4);
|
|
119
119
|
}
|
|
120
|
-
@mixin
|
|
120
|
+
@mixin aspect_ratio--16x9 {
|
|
121
121
|
@include aspect_ratio(16, 9);
|
|
122
122
|
}
|
|
123
|
-
@mixin
|
|
123
|
+
@mixin aspect_ratio--9x16 {
|
|
124
|
+
@include aspect_ratio(9, 16);
|
|
125
|
+
}
|
|
126
|
+
@mixin aspect_ratio--16x10 {
|
|
124
127
|
@include aspect_ratio(16, 10);
|
|
125
128
|
}
|
|
129
|
+
@mixin aspect_ratio--10x16 {
|
|
130
|
+
@include aspect_ratio(10, 16);
|
|
131
|
+
}
|
package/scss/mixins/_unit.scss
CHANGED
|
@@ -31,7 +31,8 @@
|
|
|
31
31
|
///
|
|
32
32
|
/// @name q
|
|
33
33
|
/// @param {Number} $multiplier - The multiplier to apply to the base Kyū unit.
|
|
34
|
-
/// @param {String} $property - The CSS property to which the calculated value
|
|
34
|
+
/// @param {String} $property - The CSS property to which the calculated value
|
|
35
|
+
/// is applied.
|
|
35
36
|
///
|
|
36
37
|
/// @example scss - Usage
|
|
37
38
|
/// .element {
|
|
@@ -47,10 +48,14 @@
|
|
|
47
48
|
/// minimum and maximum viewport width, ensuring a smooth transition.
|
|
48
49
|
///
|
|
49
50
|
/// @name fluid_type
|
|
50
|
-
/// @param {Length} $min_vw - The minimum viewport width where the fluid
|
|
51
|
-
///
|
|
52
|
-
/// @param {Length} $
|
|
53
|
-
///
|
|
51
|
+
/// @param {Length} $min_vw - The minimum viewport width where the fluid
|
|
52
|
+
/// scaling starts.
|
|
53
|
+
/// @param {Length} $max_vw - The maximum viewport width where the fluid
|
|
54
|
+
/// scaling ends.
|
|
55
|
+
/// @param {Length} $min_font_size - The minimum font size for the smallest
|
|
56
|
+
/// viewport.
|
|
57
|
+
/// @param {Length} $max_font_size - The maximum font size for the largest
|
|
58
|
+
/// viewport.
|
|
54
59
|
///
|
|
55
60
|
/// @example scss - Usage
|
|
56
61
|
/// html {
|
package/scss/tags/_index.scss
CHANGED
|
@@ -12,10 +12,12 @@
|
|
|
12
12
|
///
|
|
13
13
|
////
|
|
14
14
|
|
|
15
|
+
|
|
15
16
|
// ============================================================================
|
|
16
17
|
// Use
|
|
17
18
|
// ============================================================================
|
|
18
19
|
|
|
20
|
+
|
|
19
21
|
// ============================================================================
|
|
20
22
|
// Forward
|
|
21
23
|
// ============================================================================
|
package/scss/tags/_unit.scss
CHANGED
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
///
|
|
13
13
|
////
|
|
14
14
|
|
|
15
|
+
|
|
15
16
|
// ============================================================================
|
|
16
17
|
// Use
|
|
17
18
|
// ============================================================================
|
|
@@ -19,6 +20,7 @@
|
|
|
19
20
|
@use "../variables" as *;
|
|
20
21
|
@use "../mixins" as *;
|
|
21
22
|
|
|
23
|
+
|
|
22
24
|
// ============================================================================
|
|
23
25
|
// Classes
|
|
24
26
|
// ============================================================================
|
|
@@ -32,6 +32,8 @@ $guide--color: rgb(0, 200, 255);
|
|
|
32
32
|
$guide--graph_primary: rgba(111, 124, 126, 0.483);
|
|
33
33
|
|
|
34
34
|
$guide--bleed_primary: rgba(178, 51, 170, 0.5);
|
|
35
|
+
|
|
36
|
+
|
|
35
37
|
///
|
|
36
38
|
/// Primary Guide Color
|
|
37
39
|
/// ---------------------------------------------------------------------------
|
|
@@ -18,12 +18,14 @@
|
|
|
18
18
|
///
|
|
19
19
|
////
|
|
20
20
|
|
|
21
|
+
|
|
21
22
|
// ============================================================================
|
|
22
23
|
// Use
|
|
23
24
|
// ============================================================================
|
|
24
25
|
|
|
25
26
|
@use "unit" as *;
|
|
26
27
|
|
|
28
|
+
|
|
27
29
|
// ============================================================================
|
|
28
30
|
// Variables
|
|
29
31
|
// ============================================================================
|
|
@@ -35,26 +35,26 @@
|
|
|
35
35
|
|
|
36
36
|
///
|
|
37
37
|
/// The base unit in the Kyū measurement system. It represents 1/16th of a rem,
|
|
38
|
-
/// which is equivalent to 1px or 0.25mm.
|
|
38
|
+
/// which is equivalent to 1px in digital design or 0.25mm in physical design.
|
|
39
39
|
///
|
|
40
40
|
/// @name $q
|
|
41
41
|
/// @type Length
|
|
42
42
|
///
|
|
43
|
-
$q: 0.0625rem !default; // 1px, or 0.25mm
|
|
43
|
+
$q: 0.0625rem !default; // 1px in digital design, or 0.25mm in physical design
|
|
44
44
|
|
|
45
45
|
///
|
|
46
46
|
/// The minimum Kyū size used for fluid typography.
|
|
47
47
|
///
|
|
48
|
-
/// @type Length
|
|
49
48
|
/// @name $q_min
|
|
49
|
+
/// @type Length
|
|
50
50
|
///
|
|
51
51
|
$q_min: 0.75px !default;
|
|
52
52
|
|
|
53
53
|
///
|
|
54
54
|
/// The maximum Kyū size used for fluid typography.
|
|
55
55
|
///
|
|
56
|
-
/// @type Length
|
|
57
56
|
/// @name $q_max
|
|
57
|
+
/// @type Length
|
|
58
58
|
///
|
|
59
59
|
$q_max: 1.5px !default;
|
|
60
60
|
|
|
@@ -62,8 +62,8 @@ $q_max: 1.5px !default;
|
|
|
62
62
|
/// The minimum font size calculated using the minimum Kyū size, based on
|
|
63
63
|
/// the rem unit.
|
|
64
64
|
///
|
|
65
|
-
/// @type Length
|
|
66
65
|
/// @name $font_min
|
|
66
|
+
/// @type Length
|
|
67
67
|
///
|
|
68
68
|
$font_min: calc((1rem / $q) * $q_min) !default;
|
|
69
69
|
|
|
@@ -71,8 +71,8 @@ $font_min: calc((1rem / $q) * $q_min) !default;
|
|
|
71
71
|
/// The maximum font size calculated using the maximum Kyū size, based on
|
|
72
72
|
/// the rem unit.
|
|
73
73
|
///
|
|
74
|
-
/// @type Length
|
|
75
74
|
/// @name $font_max
|
|
75
|
+
/// @type Length
|
|
76
76
|
///
|
|
77
77
|
$font_max: calc((1rem / $q) * $q_max) !default;
|
|
78
78
|
|
|
@@ -33,12 +33,14 @@
|
|
|
33
33
|
///
|
|
34
34
|
////
|
|
35
35
|
|
|
36
|
+
|
|
36
37
|
// ============================================================================
|
|
37
38
|
// Use
|
|
38
39
|
// ============================================================================
|
|
39
40
|
|
|
40
41
|
@use "sass:map";
|
|
41
42
|
|
|
43
|
+
|
|
42
44
|
// ============================================================================
|
|
43
45
|
// Variables
|
|
44
46
|
// ============================================================================
|
|
@@ -147,7 +149,8 @@ $media_sl: map.get($breakpoints, sl) !default;
|
|
|
147
149
|
///
|
|
148
150
|
$media_dif: calc($media_sl - $media_xs);
|
|
149
151
|
|
|
150
|
-
// Uncomment below if you want to use the following predefined breakpoints
|
|
152
|
+
// Uncomment below if you want to use the following predefined breakpoints
|
|
153
|
+
// for various devices:
|
|
151
154
|
|
|
152
155
|
// $media_min: 320px !default; // Mobile
|
|
153
156
|
// $media_med: 640px !default; // Tablet
|