unit.gl 0.1.3 → 0.1.9

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.
Files changed (71) hide show
  1. package/css/unit.gl.css +253 -122
  2. package/css/unit.gl.min.css +1 -1
  3. package/js/grids.js +59 -0
  4. package/js/grids.js.map +1 -0
  5. package/js/unit.gl.js +10 -0
  6. package/js/unit.gl.js.map +1 -0
  7. package/package.json +1 -1
  8. package/scss/_reset.scss +15 -1
  9. package/scss/classes/_guide.scss +56 -54
  10. package/scss/classes/_index.scss +1 -5
  11. package/scss/classes/_ratio.scss +56 -6
  12. package/scss/dev/_banner.scss +0 -4
  13. package/scss/functions/_color.scss +1 -5
  14. package/scss/functions/_index.scss +0 -4
  15. package/scss/functions/_layer.scss +3 -6
  16. package/scss/functions/_ratio.scss +2 -5
  17. package/scss/functions/_scale.scss +8 -14
  18. package/scss/functions/_sequence.scss +0 -5
  19. package/scss/functions/_view.scss +0 -4
  20. package/scss/functions/math/_arithmetic.scss +12 -10
  21. package/scss/functions/math/_index.scss +0 -4
  22. package/scss/functions/unit/_index.scss +0 -4
  23. package/scss/functions/unit/_unit_conversion.scss +6 -30
  24. package/scss/functions/unit/_unit_functions.scss +2 -16
  25. package/scss/index.scss +12 -1
  26. package/scss/maps/_color.scss +1 -5
  27. package/scss/{variables → maps}/_device.scss +78 -73
  28. package/scss/maps/_index.scss +36 -5
  29. package/scss/{variables/_ratio.scss → maps/_interval.scss} +1 -6
  30. package/scss/{variables → maps}/_layer.scss +24 -20
  31. package/scss/{variables → maps}/_paper.scss +613 -414
  32. package/scss/maps/_ratio.scss +76 -0
  33. package/scss/maps/_scale.scss +82 -0
  34. package/scss/mixins/_device.scss +11 -8
  35. package/scss/mixins/_display.scss +35 -72
  36. package/scss/mixins/_guide.scss +151 -43
  37. package/scss/mixins/_helper.scss +2 -6
  38. package/scss/mixins/_index.scss +0 -4
  39. package/scss/mixins/_paper.scss +3 -7
  40. package/scss/mixins/_ratio.scss +79 -238
  41. package/scss/mixins/_unit.scss +1 -10
  42. package/scss/mixins/_view.scss +1 -5
  43. package/scss/tags/_index.scss +0 -4
  44. package/scss/tags/_unit.scss +0 -4
  45. package/scss/test.scss +0 -0
  46. package/scss/variables/_color.scss +7 -7
  47. package/scss/variables/_guide.scss +0 -0
  48. package/scss/variables/_index.scss +6 -40
  49. package/scss/variables/_scale.scss +4 -89
  50. package/scss/variables/_unit.scss +2 -5
  51. package/scss/variables/_view.scss +2 -7
  52. package/ts/grids.ts +92 -0
  53. package/ts/index.ts +19 -1
  54. package/scss/classes/_guides.scss +0 -141
  55. package/ts/AspectRatio.ts +0 -50
  56. package/ts/Border.ts +0 -60
  57. package/ts/BoxModel.ts +0 -68
  58. package/ts/FlexContainer.ts +0 -75
  59. package/ts/Grid.ts +0 -46
  60. package/ts/GridContainer.ts +0 -59
  61. package/ts/Layout.ts +0 -64
  62. package/ts/Position.ts +0 -53
  63. package/ts/Rectangle.ts +0 -51
  64. package/ts/ResponsiveImage.ts +0 -47
  65. package/ts/ResponsiveScale.ts +0 -44
  66. package/ts/Size.ts +0 -54
  67. package/ts/Spacing.ts +0 -106
  68. package/ts/Transform.ts +0 -71
  69. package/ts/Typography.ts +0 -75
  70. package/ts/Unit.ts +0 -81
  71. package/ts/Viewport.ts +0 -52
@@ -1,7 +1,3 @@
1
- // ============================================================================
2
- // Poster
3
- // ============================================================================
4
-
5
1
  ////
6
2
  ///
7
3
  /// Device Variables Module
@@ -20,13 +16,12 @@
20
16
  /// @access public
21
17
  ///
22
18
  /// @example scss - Usage Example
23
- /// @media (min-width: map-get($devices, "iphone-x")["min-width"]) {
19
+ /// @media (min-width: map.get($devices, "iphone_x")["min-width"]) {
24
20
  /// // Styles specific to iPhone X
25
21
  /// }
26
22
  ///
27
23
  ////
28
24
 
29
-
30
25
  // ============================================================================
31
26
  // Use
32
27
  // ============================================================================
@@ -54,125 +49,130 @@
54
49
  /// @property iPhones - iPhones with varying screen sizes and pixel densities.
55
50
  ///
56
51
  /// @example scss - Usage Example
57
- /// @media (min-width: map-get($devices, "iphone-x")["min-width"]) {
52
+ /// @media (min-width: map.get($devices, "iphone_x")["min-width"]) {
58
53
  /// // Styles specific to iPhone X
59
54
  /// }
60
55
  ///
61
- $devices: (
56
+ $device_map: (
62
57
  // Phones
63
58
  // ========================================================================
64
59
  // iPhones
65
60
  // ------------------------------------------------------------------------
66
61
  /// iPhones
67
62
  /// iPhones with varying screen sizes and pixel densities.
68
- "iphone-5": (
63
+ "iphone_5":
64
+ (
69
65
  "min-width": 320px,
70
66
  "max-width": 568px,
71
- "pixel-ratio": 2,
67
+ "pixel-ratio": 2
72
68
  ),
73
- "iphone-6": (
69
+ "iphone_6": (
74
70
  "min-width": 375px,
75
71
  "max-width": 667px,
76
- "pixel-ratio": 2,
72
+ "pixel-ratio": 2
77
73
  ),
78
- "iphone-7": (
74
+ "iphone_7": (
79
75
  "min-width": 375px,
80
76
  "max-width": 667px,
81
- "pixel-ratio": 2,
77
+ "pixel-ratio": 2
82
78
  ),
83
- "iphone-8": (
79
+ "iphone_8": (
84
80
  "min-width": 375px,
85
81
  "max-width": 667px,
86
- "pixel-ratio": 2,
82
+ "pixel-ratio": 2
87
83
  ),
88
- "iphone-x": (
84
+ "iphone_x": (
89
85
  "min-width": 375px,
90
86
  "max-width": 812px,
91
- "pixel-ratio": 3,
87
+ "pixel-ratio": 3
92
88
  ),
93
- "iphone-11": (
89
+ "iphone_11": (
94
90
  "min-width": 414px,
95
91
  "max-width": 896px,
96
- "pixel-ratio": 2,
92
+ "pixel-ratio": 2
97
93
  ),
98
- "iphone-12": (
94
+ "iphone_12": (
99
95
  "min-width": 390px,
100
96
  "max-width": 844px,
101
- "pixel-ratio": 3,
97
+ "pixel-ratio": 3
102
98
  ),
103
- "iphone-13": (
99
+ "iphone_13": (
104
100
  "min-width": 428px,
105
101
  "max-width": 926px,
106
- "pixel-ratio": 3,
102
+ "pixel-ratio": 3
107
103
  ),
108
104
  // Samsung Galaxy
109
105
  // ------------------------------------------------------------------------
110
106
  /// iPhones
111
107
  /// iPhones with varying screen sizes and pixel densities.
112
- "samsung-s10": (
108
+ "samsung_s10":
109
+ (
113
110
  "min-width": 360px,
114
111
  "max-width": 760px,
115
- "pixel-ratio": 3,
112
+ "pixel-ratio": 3
116
113
  ),
117
- "samsung-s20": (
114
+ "samsung_s20": (
118
115
  "min-width": 320px,
119
116
  "max-width": 720px,
120
- "pixel-ratio": 4,
117
+ "pixel-ratio": 4
121
118
  ),
122
- "samsung-s21": (
119
+ "samsung_s21": (
123
120
  "min-width": 320px,
124
121
  "max-width": 780px,
125
- "pixel-ratio": 3,
122
+ "pixel-ratio": 3
126
123
  ),
127
124
  // Samsung Galaxy Fold
128
125
  // ------------------------------------------------------------------------
129
126
  /// Samsung Galaxy Fold
130
127
  /// Samsung Galaxy Fold devices with foldable screens.
131
- "galaxy-fold": (
128
+ "galaxy_fold":
129
+ (
132
130
  "min-width": 280px,
133
131
  "max-width": 653px,
134
- "pixel-ratio": 3,
132
+ "pixel-ratio": 3
135
133
  ),
136
134
  // Google Pixel
137
135
  // ------------------------------------------------------------------------
138
136
  /// Google Pixel
139
137
  /// Google Pixel devices with varying screen sizes and pixel densities.
140
- "google-pixel": (
138
+ "google_pixel":
139
+ (
141
140
  "min-width": 411px,
142
141
  "max-width": 731px,
143
- "pixel-ratio": 2.6,
142
+ "pixel-ratio": 2.6
144
143
  ),
145
- "google-pixel-5": (
144
+ "google_pixel_5": (
146
145
  "min-width": 393px,
147
146
  "max-width": 851px,
148
- "pixel-ratio": 3,
147
+ "pixel-ratio": 3
149
148
  ),
150
149
  /// Other Smartphones
151
150
  /// Other popular smartphones with varying screen sizes and pixel densities.
152
- "lg-g6": (
151
+ "lg_g6":
152
+ (
153
153
  "min-width": 360px,
154
154
  "max-width": 720px,
155
- "pixel-ratio": 4,
155
+ "pixel-ratio": 4
156
156
  ),
157
- "oneplus-7t": (
157
+ "oneplus_7t": (
158
158
  "min-width": 412px,
159
159
  "max-width": 732px,
160
- "pixel-ratio": 2.5,
160
+ "pixel-ratio": 2.5
161
161
  ),
162
- "sony-xperia-1": (
162
+ "sony_xperia_1": (
163
163
  "min-width": 384px,
164
164
  "max-width": 643px,
165
- "pixel-ratio": 3,
165
+ "pixel-ratio": 3
166
166
  ),
167
- "huawei-p30": (
167
+ "huawei_p30": (
168
168
  "min-width": 360px,
169
169
  "max-width": 780px,
170
- "pixel-ratio": 3,
170
+ "pixel-ratio": 3
171
171
  ),
172
- "xiaomi-mi9": (
172
+ "xiaomi_mi9": (
173
173
  "min-width": 393px,
174
174
  "max-width": 851px,
175
- "pixel-ratio": 3,
175
+ "pixel-ratio": 3
176
176
  ),
177
177
  // Tablets
178
178
  // ========================================================================
@@ -180,39 +180,41 @@ $devices: (
180
180
  // ------------------------------------------------------------------------
181
181
  /// iPads
182
182
  /// Various models of Apple"s iPad, including iPad, iPad Pro, iPad Mini, and iPad Air.
183
- "ipad": (
183
+ "ipad":
184
+ (
184
185
  "min-width": 768px,
185
186
  "max-width": 1024px,
186
- "pixel-ratio": 2,
187
+ "pixel-ratio": 2
187
188
  ),
188
- "ipad-pro": (
189
+ "ipad_pro": (
189
190
  "min-width": 1024px,
190
191
  "max-width": 1366px,
191
- "pixel-ratio": 2,
192
+ "pixel-ratio": 2
192
193
  ),
193
- "ipad-mini": (
194
+ "ipad_mini": (
194
195
  "min-width": 768px,
195
196
  "max-width": 1024px,
196
- "pixel-ratio": 2,
197
+ "pixel-ratio": 2
197
198
  ),
198
- "ipad-air": (
199
+ "ipad_air": (
199
200
  "min-width": 820px,
200
201
  "max-width": 1180px,
201
- "pixel-ratio": 2,
202
+ "pixel-ratio": 2
202
203
  ),
203
204
  // Microsoft Surface
204
205
  // ------------------------------------------------------------------------
205
206
  /// Microsoft Surface
206
207
  /// Microsoft"s Surface devices, including Surface Duo and Surface Pro.
207
- "surface-duo": (
208
+ "surface_duo":
209
+ (
208
210
  "min-width": 540px,
209
211
  "max-width": 720px,
210
- "pixel-ratio": 2.5,
212
+ "pixel-ratio": 2.5
211
213
  ),
212
- "surface-pro": (
214
+ "surface_pro": (
213
215
  "min-width": 768px,
214
216
  "max-width": 1366px,
215
- "pixel-ratio": 2,
217
+ "pixel-ratio": 2
216
218
  ),
217
219
  // Desktops & Laptops
218
220
  // ========================================================================
@@ -220,34 +222,36 @@ $devices: (
220
222
  // ------------------------------------------------------------------------
221
223
  /// Desktops & Larger Tablets
222
224
  /// Larger devices like desktops and large tablets.
223
- "amazon-fire-hd": (
225
+ "amazon-fire-hd":
226
+ (
224
227
  "min-width": 800px,
225
228
  "max-width": 1280px,
226
- "pixel-ratio": 1.5,
229
+ "pixel-ratio": 1.5
227
230
  ),
228
- "microsoft-laptop": (
231
+ "microsoft_laptop": (
229
232
  "min-width": 1504px,
230
233
  "max-width": 2256px,
231
- "pixel-ratio": 1.5,
234
+ "pixel-ratio": 1.5
232
235
  ),
233
236
  // Mac Devices
234
237
  // ------------------------------------------------------------------------
235
238
  /// Mac Devices
236
239
  /// Various Apple Mac devices, including MacBook Air, MacBook Pro, and iMac.
237
- "macbook-air": (
240
+ "macbook_air":
241
+ (
238
242
  "min-width": 1440px,
239
243
  "max-width": 2560px,
240
- "pixel-ratio": 2,
244
+ "pixel-ratio": 2
241
245
  ),
242
- "macbook-pro": (
246
+ "macbook_pro": (
243
247
  "min-width": 1680px,
244
248
  "max-width": 3072px,
245
- "pixel-ratio": 2,
249
+ "pixel-ratio": 2
246
250
  ),
247
251
  "imac": (
248
252
  "min-width": 1920px,
249
253
  "max-width": 5120px,
250
- "pixel-ratio": 2,
254
+ "pixel-ratio": 2
251
255
  ),
252
256
 
253
257
  // Additional Devices
@@ -255,19 +259,20 @@ $devices: (
255
259
  /// Other Laptops
256
260
  /// Other popular laptops, including Surface Book, Dell XPS,
257
261
  /// and Lenovo ThinkPad.
258
- "surface-book": (
262
+ "surface_book":
263
+ (
259
264
  "min-width": 1500px,
260
265
  "max-width": 2000px,
261
- "pixel-ratio": 2,
266
+ "pixel-ratio": 2
262
267
  ),
263
- "dell-xps": (
268
+ "dell_xps": (
264
269
  "min-width": 1920px,
265
270
  "max-width": 3840px,
266
- "pixel-ratio": 2,
271
+ "pixel-ratio": 2
267
272
  ),
268
- "lenovo-thinkpad": (
273
+ "lenovo_thinkpad": (
269
274
  "min-width": 1440px,
270
275
  "max-width": 2560px,
271
- "pixel-ratio": 2,
276
+ "pixel-ratio": 2
272
277
  )
273
278
  );
@@ -1,7 +1,3 @@
1
- // ============================================================================
2
- // Poster
3
- // ============================================================================
4
-
5
1
  ////
6
2
  ///
7
3
  /// Maps Module
@@ -24,4 +20,39 @@
24
20
  // Forward
25
21
  // ============================================================================
26
22
 
27
- @forward "color";
23
+ ///
24
+ /// Forwards maps defining paper sizes etc.
25
+ ///
26
+ @forward "paper";
27
+
28
+ ///
29
+ /// Forwards device-specific configurations that aid in creating responsive
30
+ /// designs tailored to various devices.
31
+ ///
32
+ @forward "device"; // Device-specific responsive design maps
33
+
34
+ ///
35
+ /// Forwards maps related to layout layers and z-indexing, ensuring
36
+ /// consistent layering and stacking order throughout the project.
37
+ ///
38
+ @forward "layer"; // Layout layers and z-index maps
39
+
40
+ ///
41
+ /// Forwards centralized color definitions, providing a consistent color scheme
42
+ /// across the project.
43
+ ///
44
+ @forward "color"; // Centralized color definitions for the project
45
+
46
+ ///
47
+ /// Forwards aspect ratio configurations that ensure responsive elements
48
+ /// maintain their intended proportions across different devices and viewports.
49
+ ///
50
+ @forward "ratio"; // Aspect ratio configurations for responsive elements
51
+
52
+ ///
53
+ /// Forwards interval configurations that ensure responsive elements
54
+ /// maintain their intended proportions across different devices and viewports.
55
+ ///
56
+ @forward "interval"; // interval configurations for responsive elements
57
+
58
+ @forward "scale";
@@ -1,7 +1,3 @@
1
- // ============================================================================
2
- // Poster
3
- // ============================================================================
4
-
5
1
  ////
6
2
  ///
7
3
  /// Ratio Variables Module
@@ -16,7 +12,6 @@
16
12
  ///
17
13
  ////
18
14
 
19
-
20
15
  // ============================================================================
21
16
  // Use
22
17
  // ============================================================================
@@ -108,7 +103,7 @@
108
103
  /// @prop {Number} parthenon_ratio [1.618] - Ratio used in the architecture of the Parthenon.
109
104
  /// @prop {Number} le_corbusier [1.618] - Le Corbusier’s modulor ratio, used in modernist architecture.
110
105
  /// @prop {Number} vesica_piscis [1.732] - Ratio derived from the vesica piscis shape, often used in sacred geometry.
111
- $ratio_map: (
106
+ $interval_map: (
112
107
  // Musical Intervals
113
108
  // ========================================================================
114
109
  // Commonly used in creating harmonious designs based on musical theory.
@@ -1,7 +1,3 @@
1
- // ============================================================================
2
- // Poster
3
- // ============================================================================
4
-
5
1
  ////
6
2
  ///
7
3
  /// Layer Variables Module
@@ -16,17 +12,14 @@
16
12
  ///
17
13
  ////
18
14
 
19
-
20
15
  // ============================================================================
21
16
  // Use
22
17
  // ============================================================================
23
18
 
24
-
25
19
  // ============================================================================
26
20
  // Variables
27
21
  // ============================================================================
28
22
 
29
-
30
23
  ///
31
24
  /// Z-Index Layer Map
32
25
  /// ---------------------------------------------------------------------------
@@ -56,31 +49,30 @@
56
49
  ///
57
50
  /// @todo Add more layers as needed, ensuring consistent and clear naming.
58
51
  ///
59
- $layers: (
60
-
52
+ $layer_map: (
61
53
  // ========================================================================
62
- // Guides
54
+ // Guides & Development Overlays
63
55
  // ========================================================================
64
-
56
+ ///
65
57
  /// High-priority guide overlays for design and debugging.
66
58
  /// @name guides
67
59
  /// @type Number
60
+ ///
68
61
  "guides": 9998,
69
62
 
70
63
  /// Baseline guide used for text alignment and visual rhythm.
71
64
  /// @name guide_baseline
72
65
  /// @type Number
73
- "guide_baseline": 3000,
66
+ "guide_baseline": 9998,
74
67
 
75
68
  /// Graphical guides, such as grid overlays, used in design.
76
69
  /// @name guide_graph
77
70
  /// @type Number
78
- "guide_graph": 3100,
71
+ "guide_graph": 9998,
79
72
 
80
73
  // ========================================================================
81
74
  // Overlays
82
75
  // ========================================================================
83
-
84
76
  /// Z-index for modals and dialog boxes, ensuring they appear above other
85
77
  /// content.
86
78
  /// @name modal
@@ -90,26 +82,30 @@ $layers: (
90
82
  // ========================================================================
91
83
  // Interface Elements
92
84
  // ========================================================================
93
-
85
+ ///
94
86
  /// Z-index for top ribbons and banners that overlay other UI elements.
95
87
  /// @name ribbon
96
88
  /// @type Number
89
+ ///
97
90
  "ribbon": 5000,
98
91
 
92
+ ///
99
93
  /// General interface elements like headers, footers, and sidebars.
100
94
  /// @name interface
101
95
  /// @type Number
96
+ ///
102
97
  "interface": 4000,
103
98
 
99
+ ///
104
100
  /// Controls like buttons, sliders, and other interactive elements.
105
101
  /// @name control
106
102
  /// @type Number
103
+ ///
107
104
  "control": 3000,
108
105
 
109
106
  // ========================================================================
110
107
  // Content
111
108
  // ========================================================================
112
-
113
109
  /// Main content area, typically stacked below UI elements.
114
110
  /// @name content
115
111
  /// @type Number
@@ -118,7 +114,6 @@ $layers: (
118
114
  // ========================================================================
119
115
  // Background Layers
120
116
  // ========================================================================
121
-
122
117
  /// Background canvas or base layer, typically the lowest layer.
123
118
  /// @name canvas
124
119
  /// @type Number
@@ -127,20 +122,29 @@ $layers: (
127
122
  // ========================================================================
128
123
  // Special Values
129
124
  // ========================================================================
130
-
125
+ ///
131
126
  /// Maximum possible z-index value.
127
+ /// Highest layer (use sparingly)
128
+ ///
132
129
  /// @name max
133
130
  /// @type Number
131
+ ///
134
132
  "max": 9999,
135
133
 
134
+ ///
136
135
  /// Default, baseline z-index value.
136
+ ///
137
137
  /// @name mid
138
138
  /// @type Number
139
+ ///
139
140
  "mid": 0,
140
141
 
142
+ ///
141
143
  /// Minimum possible z-index value.
144
+ /// Forcefully behind everything
145
+ ///
142
146
  /// @name min
143
147
  /// @type Number
144
- "min": -9999,
145
-
148
+ ///
149
+ "min": -9999
146
150
  ) !default;