unit.gl 0.0.40 → 0.1.1
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 +0 -1
- package/css/unit.gl.css +54 -42
- package/css/unit.gl.min.css +1 -1
- package/package.json +2 -22
- package/scss/_reset.scss +20 -12
- package/scss/classes/_guide.scss +35 -40
- package/scss/classes/_guides.scss +141 -0
- package/scss/classes/_index.scss +3 -5
- package/scss/classes/_ratio.scss +3 -5
- package/scss/dev/_banner.scss +4 -7
- package/scss/dev/_index.scss +7 -0
- package/scss/functions/_color.scss +8 -11
- package/scss/functions/_index.scss +18 -11
- package/scss/functions/_layer.scss +6 -10
- package/scss/functions/_ratio.scss +13 -16
- package/scss/functions/_scale.scss +20 -18
- package/scss/functions/_sequence.scss +64 -72
- package/scss/functions/_view.scss +6 -9
- package/scss/functions/math/_arithmetic.scss +21 -30
- package/scss/functions/math/_index.scss +4 -7
- package/scss/functions/unit/_index.scss +8 -7
- package/scss/functions/unit/_unit_conversion.scss +42 -29
- package/scss/functions/unit/_unit_functions.scss +55 -43
- package/scss/index.scss +0 -1
- package/scss/maps/_color.scss +14 -14
- package/scss/maps/_index.scss +26 -0
- package/scss/mixins/_device.scss +9 -10
- package/scss/mixins/_display.scss +52 -57
- package/scss/mixins/_guide.scss +59 -81
- package/scss/mixins/_helper.scss +74 -92
- package/scss/mixins/_index.scss +12 -14
- package/scss/mixins/_paper.scss +10 -11
- package/scss/mixins/_ratio.scss +172 -76
- package/scss/mixins/_unit.scss +33 -23
- package/scss/mixins/_view.scss +47 -54
- package/scss/{_global.scss → tags/_global.scss} +12 -11
- package/scss/tags/_index.scss +5 -6
- package/scss/tags/_unit.scss +4 -11
- package/scss/variables/_color.scss +18 -20
- package/scss/variables/_device.scss +179 -73
- package/scss/variables/_index.scss +21 -22
- package/scss/variables/_layer.scss +26 -35
- package/scss/variables/_paper.scss +1022 -241
- package/scss/variables/_ratio.scss +148 -90
- package/scss/variables/_scale.scss +141 -115
- package/scss/variables/_unit.scss +20 -35
- package/scss/variables/_view.scss +54 -57
- package/ts/AspectRatio.ts +27 -6
- package/ts/Border.ts +35 -4
- package/ts/BoxModel.ts +32 -4
- package/ts/FlexContainer.ts +36 -9
- package/ts/Grid.ts +28 -3
- package/ts/GridContainer.ts +29 -3
- package/ts/Layout.ts +37 -7
- package/ts/Position.ts +29 -4
- package/ts/Rectangle.ts +26 -3
- package/ts/ResponsiveImage.ts +22 -3
- package/ts/ResponsiveScale.ts +25 -2
- package/ts/Size.ts +25 -3
- package/ts/Spacing.ts +45 -7
- package/ts/Transform.ts +37 -4
- package/ts/Typography.ts +40 -6
- package/ts/Unit.ts +34 -10
- package/ts/Viewport.ts +31 -3
- package/ts/index.ts +1 -16
- package/scss/utilities/_guides.scss +0 -103
- package/scss/utilities/_index.scss +0 -6
|
@@ -3,15 +3,15 @@
|
|
|
3
3
|
// ============================================================================
|
|
4
4
|
|
|
5
5
|
////
|
|
6
|
-
///
|
|
6
|
+
///
|
|
7
7
|
/// Variables Module
|
|
8
8
|
/// ===========================================================================
|
|
9
|
-
///
|
|
9
|
+
///
|
|
10
10
|
/// This module consolidates and forwards SCSS partials that define variables
|
|
11
11
|
/// for consistent use throughout the project. Each forwarded file encapsulates
|
|
12
12
|
/// a specific category of variables, ensuring modularity, clarity, and ease of
|
|
13
13
|
/// maintenance.
|
|
14
|
-
///
|
|
14
|
+
///
|
|
15
15
|
/// Forwarded Modules Overview:
|
|
16
16
|
/// - `layer`: Variables related to layout layers and z-indexing.
|
|
17
17
|
/// - `paper`: Defines color palettes, textures, and backgrounds.
|
|
@@ -21,14 +21,14 @@
|
|
|
21
21
|
/// - `device`: Device-specific configurations to enhance responsive design.
|
|
22
22
|
/// - `color`: Centralized color definitions for consistent theming.
|
|
23
23
|
/// - `ratio`: Aspect ratio configurations for responsive elements.
|
|
24
|
-
///
|
|
24
|
+
///
|
|
25
25
|
/// @group Variables
|
|
26
26
|
/// @author Scape Agency
|
|
27
27
|
/// @link https://unit.gl
|
|
28
28
|
/// @since 0.1.0 initial release
|
|
29
29
|
/// @todo None
|
|
30
30
|
/// @access public
|
|
31
|
-
///
|
|
31
|
+
///
|
|
32
32
|
////
|
|
33
33
|
|
|
34
34
|
|
|
@@ -42,58 +42,57 @@
|
|
|
42
42
|
// ============================================================================
|
|
43
43
|
|
|
44
44
|
|
|
45
|
-
///
|
|
45
|
+
///
|
|
46
46
|
/// Forwards variables related to layout layers and z-indexing, ensuring
|
|
47
47
|
/// consistent layering and stacking order throughout the project.
|
|
48
|
-
///
|
|
48
|
+
///
|
|
49
49
|
@forward "layer"; // Layout layers and z-index variables
|
|
50
50
|
|
|
51
51
|
|
|
52
|
-
///
|
|
52
|
+
///
|
|
53
53
|
/// Forwards variables defining paper sizes etc.
|
|
54
|
-
///
|
|
54
|
+
///
|
|
55
55
|
@forward "paper";
|
|
56
56
|
|
|
57
57
|
|
|
58
|
-
///
|
|
58
|
+
///
|
|
59
59
|
/// Forwards variables managing scaling factors for typography and responsive
|
|
60
60
|
/// elements, ensuring that elements scale proportionally across different
|
|
61
61
|
/// viewports.
|
|
62
|
-
///
|
|
62
|
+
///
|
|
63
63
|
@forward "scale"; // Typography scaling and responsive element sizing
|
|
64
64
|
|
|
65
65
|
|
|
66
|
-
///
|
|
66
|
+
///
|
|
67
67
|
/// Forwards viewport-specific variables, such as breakpoints, to facilitate
|
|
68
68
|
/// responsive design practices.
|
|
69
|
-
///
|
|
69
|
+
///
|
|
70
70
|
@forward "view"; // Viewport-specific variables and breakpoints
|
|
71
71
|
|
|
72
72
|
|
|
73
|
-
///
|
|
73
|
+
///
|
|
74
74
|
/// Forwards device-specific configurations that aid in creating responsive
|
|
75
75
|
/// designs tailored to various devices.
|
|
76
|
-
///
|
|
76
|
+
///
|
|
77
77
|
@forward "device"; // Device-specific responsive design variables
|
|
78
78
|
|
|
79
79
|
|
|
80
|
-
///
|
|
80
|
+
///
|
|
81
81
|
/// Forwards centralized color definitions, providing a consistent color scheme
|
|
82
82
|
/// across the project.
|
|
83
|
-
///
|
|
83
|
+
///
|
|
84
84
|
@forward "color"; // Centralized color definitions for the project
|
|
85
85
|
|
|
86
86
|
|
|
87
|
-
///
|
|
87
|
+
///
|
|
88
88
|
/// Forwards aspect ratio configurations that ensure responsive elements
|
|
89
89
|
/// maintain their intended proportions across different devices and viewports.
|
|
90
|
-
///
|
|
90
|
+
///
|
|
91
91
|
@forward "ratio"; // Aspect ratio configurations for responsive elements
|
|
92
92
|
|
|
93
|
-
///
|
|
93
|
+
///
|
|
94
94
|
/// Forwards variables related to measurement units, spacing, and size
|
|
95
95
|
/// definitions. Useful for maintaining consistent sizing across different
|
|
96
96
|
/// components.
|
|
97
|
-
///
|
|
97
|
+
///
|
|
98
98
|
@forward "unit"; // Measurement units and spacing
|
|
99
|
-
|
|
@@ -3,17 +3,17 @@
|
|
|
3
3
|
// ============================================================================
|
|
4
4
|
|
|
5
5
|
////
|
|
6
|
-
///
|
|
6
|
+
///
|
|
7
7
|
/// Layer Variables Module
|
|
8
8
|
/// ===========================================================================
|
|
9
|
-
///
|
|
9
|
+
///
|
|
10
10
|
/// @group Layer
|
|
11
11
|
/// @author Scape Agency
|
|
12
12
|
/// @link https://unit.gl
|
|
13
13
|
/// @since 0.1.0 initial release
|
|
14
14
|
/// @todo None
|
|
15
15
|
/// @access public
|
|
16
|
-
///
|
|
16
|
+
///
|
|
17
17
|
////
|
|
18
18
|
|
|
19
19
|
|
|
@@ -27,33 +27,33 @@
|
|
|
27
27
|
// ============================================================================
|
|
28
28
|
|
|
29
29
|
|
|
30
|
-
///
|
|
30
|
+
///
|
|
31
31
|
/// Z-Index Layer Map
|
|
32
32
|
/// ---------------------------------------------------------------------------
|
|
33
33
|
///
|
|
34
34
|
/// A map defining the z-index layers used to manage the stacking order of UI
|
|
35
35
|
/// elements. Each key in the map represents a specific layer, with an
|
|
36
36
|
/// associated numeric value indicating its z-index.
|
|
37
|
-
///
|
|
37
|
+
///
|
|
38
38
|
/// This map defines the z-index layers used throughout the project to manage
|
|
39
39
|
/// the stacking order of various interface elements. Adjustments can be made
|
|
40
40
|
/// by modifying the values associated with each layer.
|
|
41
|
-
///
|
|
41
|
+
///
|
|
42
42
|
/// - **Guides**: High-priority overlays for design guides.
|
|
43
43
|
/// - **Overlays**: Elements like modals that need to appear above other content.
|
|
44
44
|
/// - **Interface Elements**: General UI components, ribbons, and controls.
|
|
45
45
|
/// - **Content**: Main content areas, typically stacked below UI elements.
|
|
46
46
|
/// - **Background Layers**: Base layers like canvases, typically behind content.
|
|
47
47
|
/// - **Special Values**: Special z-index values for maximum, minimum, and baseline.
|
|
48
|
-
///
|
|
48
|
+
///
|
|
49
49
|
/// @name layers
|
|
50
50
|
/// @type Map
|
|
51
|
-
///
|
|
51
|
+
///
|
|
52
52
|
/// @example scss - Usage Example
|
|
53
53
|
/// .element {
|
|
54
|
-
/// z-index: z(
|
|
54
|
+
/// z-index: z("modal");
|
|
55
55
|
/// }
|
|
56
|
-
///
|
|
56
|
+
///
|
|
57
57
|
/// @todo Add more layers as needed, ensuring consistent and clear naming.
|
|
58
58
|
///
|
|
59
59
|
$layers: (
|
|
@@ -61,95 +61,86 @@ $layers: (
|
|
|
61
61
|
// ========================================================================
|
|
62
62
|
// Guides
|
|
63
63
|
// ========================================================================
|
|
64
|
-
|
|
64
|
+
|
|
65
65
|
/// High-priority guide overlays for design and debugging.
|
|
66
66
|
/// @name guides
|
|
67
67
|
/// @type Number
|
|
68
|
-
"guides":
|
|
68
|
+
"guides": 9998,
|
|
69
69
|
|
|
70
|
-
|
|
71
70
|
/// Baseline guide used for text alignment and visual rhythm.
|
|
72
71
|
/// @name guide_baseline
|
|
73
72
|
/// @type Number
|
|
74
|
-
"guide_baseline":
|
|
73
|
+
"guide_baseline": 3000,
|
|
75
74
|
|
|
76
|
-
|
|
77
75
|
/// Graphical guides, such as grid overlays, used in design.
|
|
78
76
|
/// @name guide_graph
|
|
79
77
|
/// @type Number
|
|
80
|
-
"guide_graph":
|
|
78
|
+
"guide_graph": 3100,
|
|
81
79
|
|
|
82
80
|
// ========================================================================
|
|
83
81
|
// Overlays
|
|
84
82
|
// ========================================================================
|
|
85
83
|
|
|
86
|
-
|
|
87
|
-
///
|
|
84
|
+
/// Z-index for modals and dialog boxes, ensuring they appear above other
|
|
85
|
+
/// content.
|
|
88
86
|
/// @name modal
|
|
89
87
|
/// @type Number
|
|
90
|
-
"modal":
|
|
88
|
+
"modal": 7000,
|
|
91
89
|
|
|
92
90
|
// ========================================================================
|
|
93
91
|
// Interface Elements
|
|
94
92
|
// ========================================================================
|
|
95
93
|
|
|
96
|
-
|
|
97
94
|
/// Z-index for top ribbons and banners that overlay other UI elements.
|
|
98
95
|
/// @name ribbon
|
|
99
96
|
/// @type Number
|
|
100
|
-
"ribbon":
|
|
97
|
+
"ribbon": 5000,
|
|
101
98
|
|
|
102
|
-
|
|
103
99
|
/// General interface elements like headers, footers, and sidebars.
|
|
104
100
|
/// @name interface
|
|
105
101
|
/// @type Number
|
|
106
|
-
"interface":
|
|
102
|
+
"interface": 4000,
|
|
107
103
|
|
|
108
|
-
|
|
109
104
|
/// Controls like buttons, sliders, and other interactive elements.
|
|
110
105
|
/// @name control
|
|
111
106
|
/// @type Number
|
|
112
|
-
"control":
|
|
107
|
+
"control": 3000,
|
|
113
108
|
|
|
114
109
|
// ========================================================================
|
|
115
110
|
// Content
|
|
116
111
|
// ========================================================================
|
|
117
112
|
|
|
118
|
-
|
|
119
113
|
/// Main content area, typically stacked below UI elements.
|
|
120
114
|
/// @name content
|
|
121
115
|
/// @type Number
|
|
122
|
-
"content":
|
|
116
|
+
"content": 2000,
|
|
123
117
|
|
|
124
118
|
// ========================================================================
|
|
125
119
|
// Background Layers
|
|
126
120
|
// ========================================================================
|
|
127
121
|
|
|
128
|
-
|
|
129
122
|
/// Background canvas or base layer, typically the lowest layer.
|
|
130
123
|
/// @name canvas
|
|
131
124
|
/// @type Number
|
|
132
|
-
"canvas":
|
|
125
|
+
"canvas": -1000,
|
|
133
126
|
|
|
134
127
|
// ========================================================================
|
|
135
128
|
// Special Values
|
|
136
129
|
// ========================================================================
|
|
137
|
-
|
|
130
|
+
|
|
138
131
|
/// Maximum possible z-index value.
|
|
139
132
|
/// @name max
|
|
140
133
|
/// @type Number
|
|
141
|
-
"max": 9999,
|
|
134
|
+
"max": 9999,
|
|
142
135
|
|
|
143
|
-
|
|
144
136
|
/// Default, baseline z-index value.
|
|
145
137
|
/// @name mid
|
|
146
138
|
/// @type Number
|
|
147
|
-
"mid": 0,
|
|
139
|
+
"mid": 0,
|
|
148
140
|
|
|
149
|
-
|
|
150
141
|
/// Minimum possible z-index value.
|
|
151
142
|
/// @name min
|
|
152
143
|
/// @type Number
|
|
153
|
-
"min":
|
|
144
|
+
"min": -9999,
|
|
154
145
|
|
|
155
146
|
) !default;
|