unit.gl 0.0.28 → 0.0.29

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/css/unit.gl.css CHANGED
@@ -296,4 +296,249 @@ html {
296
296
  font-size: 24px;
297
297
  }
298
298
  }
299
+
300
+ .ratio_1x1 {
301
+ aspect-ratio: 1;
302
+ width: 100%;
303
+ position: relative;
304
+ overflow: hidden;
305
+ display: inline-block;
306
+ }
307
+
308
+ .ratio_1x2 {
309
+ aspect-ratio: 0.5;
310
+ width: 100%;
311
+ position: relative;
312
+ overflow: hidden;
313
+ display: inline-block;
314
+ }
315
+
316
+ .ratio_2x1 {
317
+ aspect-ratio: 2;
318
+ width: 100%;
319
+ position: relative;
320
+ overflow: hidden;
321
+ display: inline-block;
322
+ }
323
+
324
+ .ratio_1x3 {
325
+ aspect-ratio: 0.3333333333;
326
+ width: 100%;
327
+ position: relative;
328
+ overflow: hidden;
329
+ display: inline-block;
330
+ }
331
+
332
+ .ratio_3x1 {
333
+ aspect-ratio: 3;
334
+ width: 100%;
335
+ position: relative;
336
+ overflow: hidden;
337
+ display: inline-block;
338
+ }
339
+
340
+ .ratio_1x4 {
341
+ aspect-ratio: 0.25;
342
+ width: 100%;
343
+ position: relative;
344
+ overflow: hidden;
345
+ display: inline-block;
346
+ }
347
+
348
+ .ratio_4x1 {
349
+ aspect-ratio: 4;
350
+ width: 100%;
351
+ position: relative;
352
+ overflow: hidden;
353
+ display: inline-block;
354
+ }
355
+
356
+ .ratio_3x2 {
357
+ aspect-ratio: 1.5;
358
+ width: 100%;
359
+ position: relative;
360
+ overflow: hidden;
361
+ display: inline-block;
362
+ }
363
+
364
+ .ratio_2x3 {
365
+ aspect-ratio: 0.6666666667;
366
+ width: 100%;
367
+ position: relative;
368
+ overflow: hidden;
369
+ display: inline-block;
370
+ }
371
+
372
+ .ratio_4x3 {
373
+ aspect-ratio: 1.3333333333;
374
+ width: 100%;
375
+ position: relative;
376
+ overflow: hidden;
377
+ display: inline-block;
378
+ }
379
+
380
+ .ratio_3x4 {
381
+ aspect-ratio: 0.75;
382
+ width: 100%;
383
+ position: relative;
384
+ overflow: hidden;
385
+ display: inline-block;
386
+ }
387
+
388
+ .ratio_16x9 {
389
+ aspect-ratio: 1.7777777778;
390
+ width: 100%;
391
+ position: relative;
392
+ overflow: hidden;
393
+ display: inline-block;
394
+ }
395
+
396
+ .ratio_16x10 {
397
+ aspect-ratio: 1.6;
398
+ width: 100%;
399
+ position: relative;
400
+ overflow: hidden;
401
+ display: inline-block;
402
+ }
403
+
404
+ .ratio_p_1x1 {
405
+ padding-bottom: 100%;
406
+ width: 100%;
407
+ position: relative;
408
+ overflow: hidden;
409
+ display: inline-block;
410
+ }
411
+
412
+ .ratio_p_1x2 {
413
+ padding-bottom: 200%;
414
+ width: 100%;
415
+ position: relative;
416
+ overflow: hidden;
417
+ display: inline-block;
418
+ }
419
+
420
+ .ratio_p_2x1 {
421
+ padding-bottom: 50%;
422
+ width: 100%;
423
+ position: relative;
424
+ overflow: hidden;
425
+ display: inline-block;
426
+ }
427
+
428
+ .ratio_p_1x3 {
429
+ padding-bottom: 300%;
430
+ width: 100%;
431
+ position: relative;
432
+ overflow: hidden;
433
+ display: inline-block;
434
+ }
435
+
436
+ .ratio_p_3x1 {
437
+ padding-bottom: 33.33%;
438
+ width: 100%;
439
+ position: relative;
440
+ overflow: hidden;
441
+ display: inline-block;
442
+ }
443
+
444
+ .ratio_p_1x4 {
445
+ padding-bottom: 400%;
446
+ width: 100%;
447
+ position: relative;
448
+ overflow: hidden;
449
+ display: inline-block;
450
+ }
451
+
452
+ .ratio_p_4x1 {
453
+ padding-bottom: 25%;
454
+ width: 100%;
455
+ position: relative;
456
+ overflow: hidden;
457
+ display: inline-block;
458
+ }
459
+
460
+ .ratio_p_3x2 {
461
+ padding-bottom: 66.67%;
462
+ width: 100%;
463
+ position: relative;
464
+ overflow: hidden;
465
+ display: inline-block;
466
+ }
467
+
468
+ .ratio_p_2x3 {
469
+ padding-bottom: 150%;
470
+ width: 100%;
471
+ position: relative;
472
+ overflow: hidden;
473
+ display: inline-block;
474
+ }
475
+
476
+ .ratio_p_4x3 {
477
+ padding-bottom: 75%;
478
+ width: 100%;
479
+ position: relative;
480
+ overflow: hidden;
481
+ display: inline-block;
482
+ }
483
+
484
+ .ratio_p_3x4 {
485
+ padding-bottom: 133.33%;
486
+ width: 100%;
487
+ position: relative;
488
+ overflow: hidden;
489
+ display: inline-block;
490
+ }
491
+
492
+ .ratio_p_16x9 {
493
+ padding-bottom: 56.25%;
494
+ width: 100%;
495
+ position: relative;
496
+ overflow: hidden;
497
+ display: inline-block;
498
+ }
499
+
500
+ .ratio_p_16x10 {
501
+ padding-bottom: 62.5%;
502
+ width: 100%;
503
+ position: relative;
504
+ overflow: hidden;
505
+ display: inline-block;
506
+ }
507
+
508
+ .guide {
509
+ position: absolute;
510
+ top: 0;
511
+ left: 0;
512
+ width: 100%;
513
+ height: 100%;
514
+ margin: 0;
515
+ pointer-events: none;
516
+ z-index: 9999;
517
+ }
518
+
519
+ .guide_graph {
520
+ position: absolute;
521
+ top: 0;
522
+ left: 0;
523
+ width: 100%;
524
+ height: 100%;
525
+ margin: 0;
526
+ pointer-events: none;
527
+ z-index: 9999;
528
+ background-size: 0.25rem 0.25rem;
529
+ background-image: repeating-linear-gradient(to bottom, rgba(50, 50, 50, 0.25) 0 1px, transparent 1px 100%), repeating-linear-gradient(to right, rgba(50, 50, 50, 0.25) 0 1px, transparent 1px 100%);
530
+ }
531
+
532
+ .guide_baseline {
533
+ position: absolute;
534
+ top: 0;
535
+ left: 0;
536
+ width: 100%;
537
+ height: 100%;
538
+ margin: 0;
539
+ pointer-events: none;
540
+ z-index: 9999;
541
+ background-size: 100% 1.5rem;
542
+ background-image: repeating-linear-gradient(to bottom, cyan 0 1px, transparent 1px 100%);
543
+ }
299
544
  /*# sourceMappingURL=to.css.map */
@@ -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{margin:0;-webkit-margin-before:0;margin-block-start:0;-webkit-margin-after:0;margin-block-end:0;-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:0;margin-inline-end:0;padding:0}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}.paper.ansi_a{height:11in;width:8.5in}.paper.q0{height:1080mm;width:720mm}.paper.q1{height:720mm;width:540mm}.paper.q2{height:540mm;width:360mm}.paper.q3{height:360mm;width:270mm}.paper.q4{height:270mm;width:180mm}.paper.q5{height:180mm;width:135mm}.paper.q6{height:135mm;width:90mm}.paper.q7{height:90mm;width:62.5mm}.paper.q8{height:62.5mm;width:45mm}.paper.q9{height:45mm;width:31.25mm}.paper.q10{height:31.25mm;width:22.5mm}.paper.iso_a0{height:1189mm;width:841mm}.paper.iso_a1{height:841mm;width:594mm}.paper.iso_a2{height:594mm;width:420mm}.paper.iso_a3{height:420mm;width:297mm}.paper.iso_a4{height:297mm;width:210mm}.paper.iso_a5{height:210mm;width:148mm}.paper.iso_a6{height:148mm;width:105mm}.paper.iso_a7{height:105mm;width:74mm}.paper.iso_a8{height:74mm;width:52mm}.paper.iso_a9{height:52mm;width:37mm}.paper.iso_a10{height:37mm;width:26mm}:root{--q:$q}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}}
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{margin:0;-webkit-margin-before:0;margin-block-start:0;-webkit-margin-after:0;margin-block-end:0;-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:0;margin-inline-end:0;padding:0}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}.paper.ansi_a{height:11in;width:8.5in}.paper.q0{height:1080mm;width:720mm}.paper.q1{height:720mm;width:540mm}.paper.q2{height:540mm;width:360mm}.paper.q3{height:360mm;width:270mm}.paper.q4{height:270mm;width:180mm}.paper.q5{height:180mm;width:135mm}.paper.q6{height:135mm;width:90mm}.paper.q7{height:90mm;width:62.5mm}.paper.q8{height:62.5mm;width:45mm}.paper.q9{height:45mm;width:31.25mm}.paper.q10{height:31.25mm;width:22.5mm}.paper.iso_a0{height:1189mm;width:841mm}.paper.iso_a1{height:841mm;width:594mm}.paper.iso_a2{height:594mm;width:420mm}.paper.iso_a3{height:420mm;width:297mm}.paper.iso_a4{height:297mm;width:210mm}.paper.iso_a5{height:210mm;width:148mm}.paper.iso_a6{height:148mm;width:105mm}.paper.iso_a7{height:105mm;width:74mm}.paper.iso_a8{height:74mm;width:52mm}.paper.iso_a9{height:52mm;width:37mm}.paper.iso_a10{height:37mm;width:26mm}:root{--q:$q}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}}.ratio_1x1{aspect-ratio:1}.ratio_1x1,.ratio_1x2{display:inline-block;overflow:hidden;position:relative;width:100%}.ratio_1x2{aspect-ratio:.5}.ratio_2x1{aspect-ratio:2}.ratio_1x3,.ratio_2x1{display:inline-block;overflow:hidden;position:relative;width:100%}.ratio_1x3{aspect-ratio:.3333333333}.ratio_3x1{aspect-ratio:3}.ratio_1x4,.ratio_3x1{display:inline-block;overflow:hidden;position:relative;width:100%}.ratio_1x4{aspect-ratio:.25}.ratio_4x1{aspect-ratio:4}.ratio_3x2,.ratio_4x1{display:inline-block;overflow:hidden;position:relative;width:100%}.ratio_3x2{aspect-ratio:1.5}.ratio_2x3{aspect-ratio:.6666666667}.ratio_2x3,.ratio_4x3{display:inline-block;overflow:hidden;position:relative;width:100%}.ratio_4x3{aspect-ratio:1.3333333333}.ratio_3x4{aspect-ratio:.75}.ratio_16x9,.ratio_3x4{display:inline-block;overflow:hidden;position:relative;width:100%}.ratio_16x9{aspect-ratio:1.7777777778}.ratio_16x10{aspect-ratio:1.6}.ratio_16x10,.ratio_p_1x1{display:inline-block;overflow:hidden;position:relative;width:100%}.ratio_p_1x1{padding-bottom:100%}.ratio_p_1x2{padding-bottom:200%}.ratio_p_1x2,.ratio_p_2x1{display:inline-block;overflow:hidden;position:relative;width:100%}.ratio_p_2x1{padding-bottom:50%}.ratio_p_1x3{padding-bottom:300%}.ratio_p_1x3,.ratio_p_3x1{display:inline-block;overflow:hidden;position:relative;width:100%}.ratio_p_3x1{padding-bottom:33.33%}.ratio_p_1x4{padding-bottom:400%}.ratio_p_1x4,.ratio_p_4x1{display:inline-block;overflow:hidden;position:relative;width:100%}.ratio_p_4x1{padding-bottom:25%}.ratio_p_3x2{padding-bottom:66.67%}.ratio_p_2x3,.ratio_p_3x2{display:inline-block;overflow:hidden;position:relative;width:100%}.ratio_p_2x3{padding-bottom:150%}.ratio_p_4x3{padding-bottom:75%}.ratio_p_3x4,.ratio_p_4x3{display:inline-block;overflow:hidden;position:relative;width:100%}.ratio_p_3x4{padding-bottom:133.33%}.ratio_p_16x9{padding-bottom:56.25%}.ratio_p_16x10,.ratio_p_16x9{display:inline-block;overflow:hidden;position:relative;width:100%}.ratio_p_16x10{padding-bottom:62.5%}.guide,.guide_graph{height:100%;left:0;margin:0;pointer-events:none;position:absolute;top:0;width:100%;z-index:9999}.guide_graph{background-image:repeating-linear-gradient(180deg,rgba(50,50,50,.25) 0 1px,transparent 1px 100%),repeating-linear-gradient(90deg,rgba(50,50,50,.25) 0 1px,transparent 1px 100%);background-size:.25rem .25rem}.guide_baseline{background-image:repeating-linear-gradient(180deg,cyan 0 1px,transparent 1px 100%);background-size:100% 1.5rem;height:100%;left:0;margin:0;pointer-events:none;position:absolute;top:0;width:100%;z-index:9999}
2
2
  /*# sourceMappingURL=to.css.map */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "unit.gl",
3
- "version": "0.0.28",
3
+ "version": "0.0.29",
4
4
  "description": "Layout Engine.",
5
5
  "keywords": [
6
6
  "unit.gl",
@@ -9,6 +9,7 @@
9
9
  "q",
10
10
  "stylescape",
11
11
  "sass",
12
+ "typography",
12
13
  "fluid type",
13
14
  "responsive",
14
15
  "front-end",
package/scss/_scale.scss CHANGED
@@ -32,22 +32,6 @@ $line_height_base: calc($line_height_scalar * $rhythm_base); // Base line heigh
32
32
 
33
33
 
34
34
 
35
- $basepoint: (
36
- 1: basepoint( 1),
37
- 2: basepoint( 2),
38
- 3: basepoint( 3),
39
- 4: basepoint( 4),
40
- 5: basepoint( 5),
41
- 6: basepoint( 6),
42
- 7: basepoint( 7),
43
- 8: basepoint( 8),
44
- 9: basepoint( 9),
45
- 10: basepoint(10),
46
- 11: basepoint(11),
47
- 12: basepoint(12),
48
- ) !default;
49
-
50
-
51
35
  // Typography ladder map
52
36
  $typographic_scale: (
53
37
  1: q( 4),
@@ -92,94 +76,8 @@ $typographic_scale: (
92
76
 
93
77
 
94
78
 
95
-
96
-
97
-
98
-
99
-
100
-
101
-
102
-
103
-
104
-
105
-
106
-
107
-
108
-
109
-
110
-
111
-
112
- // point_base
113
-
114
- // $rhythm_base: 4;
115
-
116
-
117
-
118
-
119
-
120
-
121
-
122
- // Vertical Rhythm Function
123
- // Functions to maintain consistent vertical rhythm (spacing and heights) across your layout.
124
-
125
-
126
-
127
- // $base-font-size: 16px; // Base font size
128
- // $line-height: 24px; // Base line height
129
-
130
- // @function rhythm($lines: 1) {
131
- // @return $lines * $line-height;
132
- // }
133
-
134
- // @function font-size-to-line-height($font-size) {
135
- // @return floor($font-size / $line-height) * $line-height;
136
- // }
137
-
138
-
139
-
140
- // @mixin heading-baseline($font-size) {
141
- // font-size: $font-size;
142
- // line-height: baseline-grid($font-size);
143
- // }
144
-
145
- // // Typography Ladder Definition
146
- // $typography-ladder: (
147
- // 'h1': (font-size: 2.5rem, line-height: 1.2),
148
- // 'h2': (font-size: 2rem, line-height: 1.3),
149
- // 'h3': (font-size: 1.75rem, line-height: 1.4),
150
- // 'h4': (font-size: 1.5rem, line-height: 1.4),
151
- // 'h5': (font-size: 1.25rem, line-height: 1.5),
152
- // 'h6': (font-size: 1rem, line-height: 1.6),
153
- // 'body-large': (font-size: 1.125rem, line-height: 1.6),
154
- // 'body': (font-size: 1rem, line-height: 1.6),
155
- // 'body-small': (font-size: 0.875rem, line-height: 1.7),
156
- // 'caption': (font-size: 0.75rem, line-height: 1.8)
157
- // ) !default;
158
-
159
-
160
- // Calculate dynamic font size
161
- $font_size: calc(($q_unit / $q_base) * $q) !default;
162
-
163
- // Corresponding minimum and maximum font sizes
164
- $font_min: calc(($q_unit / $q) * $q_min) !default;
165
- $font_max: calc(($q_unit / $q) * $q_max) !default;
166
-
167
-
168
-
169
-
170
- // Apply
171
- // ============================================================================
172
-
173
- // Apply Fluid Typography
174
- html {
175
- font-size: $font_size_base;
176
- line-height: $line_height_base;
177
- // font-size: $font_size;
178
- }
179
-
180
-
181
-
182
-
79
+ // Kyu Point Scale
80
+ // ----------------------------------------------------------------------------
183
81
 
184
82
  $basepoint_scale: 4;
185
83
 
@@ -256,14 +154,3 @@ $baseline: (
256
154
 
257
155
 
258
156
 
259
-
260
-
261
-
262
-
263
-
264
-
265
- // @function baseline-grid($font-size, $line-height: $base-line-height) {
266
- // @return ceil($font-size / $line-height) * $line-height;
267
- // }
268
-
269
-
package/scss/_unit.scss CHANGED
@@ -49,10 +49,6 @@ $q: 0.0625rem !default; // 1px, or 0.25mm
49
49
 
50
50
 
51
51
 
52
-
53
-
54
-
55
-
56
52
  // Minimum and maximum Kyū sizes
57
53
  $q_min: 0.75px !default;
58
54
  $q_max: 1.50px !default;
package/scss/index.scss CHANGED
@@ -13,7 +13,6 @@
13
13
  // limitations under the License.
14
14
 
15
15
 
16
- @charset "utf-8";
17
16
 
18
17
  /**
19
18
  * unit.gl
@@ -27,28 +26,26 @@
27
26
  * @license Apache 2.0 License (https://github.com/scape-agency/unit.gl/blob/main/LICENSE)
28
27
  */
29
28
 
30
- @use "sass:math";
29
+ @charset "utf-8";
31
30
 
31
+ @use "sass:math";
32
32
 
33
33
 
34
34
  @import "_reset";
35
35
  @import "_global";
36
36
  @import "_layer";
37
37
 
38
-
39
38
  @import "_paper";
40
39
 
41
-
42
40
  @import "_view";
43
41
 
42
+ @import "_unit_conversion";
44
43
  @import "_unit_functions";
45
44
  @import "_unit";
46
45
 
47
46
 
48
- // @import "_scale";
49
-
50
- // @import "_helper";
51
- // @import "_guide";
52
-
47
+ @import "_ratio";
48
+ @import "_scale";
53
49
 
54
- // @import "base/base";
50
+ @import "_helper";
51
+ @import "_guide";