unit.gl 0.0.35 → 0.0.39
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/LICENSE +21 -201
- package/README.md +30 -74
- package/css/unit.gl.css +28 -65
- package/css/unit.gl.min.css +1 -1
- package/package.json +13 -8
- package/scss/_global.scss +5 -23
- package/scss/_reset.scss +13 -15
- package/scss/classes/_guide.scss +126 -0
- package/scss/classes/_index.scss +25 -11
- package/scss/classes/_ratio.scss +30 -0
- package/scss/dev/_banner.scss +30 -1
- package/scss/dev/_index.scss +0 -0
- package/scss/functions/_color.scss +40 -0
- package/scss/functions/_index.scss +39 -16
- package/scss/functions/_layer.scss +48 -0
- package/scss/functions/_ratio.scss +58 -157
- package/scss/functions/_scale.scss +55 -49
- package/scss/functions/_sequence.scss +154 -126
- package/scss/functions/_view.scss +40 -0
- package/scss/functions/math/_arithmetic.scss +102 -0
- package/scss/functions/math/_index.scss +30 -0
- package/scss/functions/unit/_index.scss +30 -0
- package/scss/functions/unit/_unit_conversion.scss +94 -0
- package/scss/functions/{_unit_functions.scss → unit/_unit_functions.scss} +70 -36
- package/scss/index.scss +2 -16
- package/scss/maps/_color.scss +43 -0
- package/scss/maps/_index.scss +1 -0
- package/scss/mixins/_device.scss +63 -25
- package/scss/mixins/_display.scss +106 -44
- package/scss/mixins/_guide.scss +191 -158
- package/scss/mixins/_helper.scss +287 -52
- package/scss/mixins/_index.scss +50 -17
- package/scss/mixins/_paper.scss +38 -17
- package/scss/mixins/_ratio.scss +30 -13
- package/scss/mixins/_unit.scss +94 -0
- package/scss/mixins/_view.scss +123 -44
- package/scss/tags/_index.scss +30 -0
- package/scss/tags/_unit.scss +40 -0
- package/scss/utilities/_guides.scss +103 -0
- package/scss/utilities/_index.scss +6 -0
- package/scss/variables/_color.scss +83 -0
- package/scss/variables/_device.scss +140 -50
- package/scss/variables/_index.scss +84 -16
- package/scss/variables/_layer.scss +148 -51
- package/scss/variables/_paper.scss +243 -17
- package/scss/variables/_ratio.scss +224 -0
- package/scss/variables/_scale.scss +230 -104
- package/scss/variables/_unit.scss +76 -72
- package/scss/variables/_view.scss +135 -39
- package/ts/AspectRatio.ts +29 -0
- package/ts/Border.ts +29 -0
- package/ts/BoxModel.ts +40 -0
- package/ts/FlexContainer.ts +48 -0
- package/ts/Grid.ts +21 -0
- package/ts/GridContainer.ts +33 -0
- package/ts/Layout.ts +34 -0
- package/ts/Position.ts +28 -0
- package/ts/Rectangle.ts +28 -0
- package/ts/ResponsiveImage.ts +28 -0
- package/ts/ResponsiveScale.ts +21 -0
- package/ts/Size.ts +32 -0
- package/ts/Spacing.ts +68 -0
- package/ts/Transform.ts +38 -0
- package/ts/Typography.ts +41 -0
- package/ts/Unit.ts +57 -0
- package/ts/Viewport.ts +24 -0
- package/js/index.d.ts +0 -1
- package/js/index.js +0 -3
- package/js/unit.gl.min.js +0 -1
- package/scss/classes/_paper.scss +0 -97
- package/scss/functions/_arithmetic.scss +0 -64
- package/scss/functions/_unit_conversion.scss +0 -77
|
@@ -1,77 +1,167 @@
|
|
|
1
|
-
//
|
|
1
|
+
// ============================================================================
|
|
2
|
+
// Poster
|
|
3
|
+
// ============================================================================
|
|
2
4
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
5
|
+
////
|
|
6
|
+
///
|
|
7
|
+
/// Device Variables Module
|
|
8
|
+
/// ===========================================================================
|
|
9
|
+
///
|
|
10
|
+
/// This file defines a map of device attributes, including screen dimensions
|
|
11
|
+
/// and pixel ratios, for a variety of devices. This map is structured for
|
|
12
|
+
/// easy access and modification, ensuring responsive designs that cater to
|
|
13
|
+
/// a wide range of devices.
|
|
14
|
+
///
|
|
15
|
+
/// @group Color
|
|
16
|
+
/// @author Scape Agency
|
|
17
|
+
/// @link https://unit.gl
|
|
18
|
+
/// @since 0.1.0 initial release
|
|
19
|
+
/// @todo None
|
|
20
|
+
/// @access public
|
|
21
|
+
///
|
|
22
|
+
/// @example scss - Usage Example
|
|
23
|
+
/// @media (min-width: map-get($devices, "iphone-x")["min-width"]) {
|
|
24
|
+
/// // Styles specific to iPhone X
|
|
25
|
+
/// }
|
|
26
|
+
///
|
|
27
|
+
////
|
|
6
28
|
|
|
7
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
29
|
|
|
9
|
-
//
|
|
10
|
-
//
|
|
11
|
-
//
|
|
12
|
-
// See the License for the specific language governing permissions and
|
|
13
|
-
// limitations under the License.
|
|
30
|
+
// ============================================================================
|
|
31
|
+
// Use
|
|
32
|
+
// ============================================================================
|
|
14
33
|
|
|
15
34
|
|
|
16
|
-
// Device Attribute Map
|
|
17
35
|
// ============================================================================
|
|
36
|
+
// Variables
|
|
37
|
+
// ============================================================================
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
///
|
|
41
|
+
/// Device Attribute Map
|
|
42
|
+
/// ---------------------------------------------------------------------------
|
|
43
|
+
///
|
|
44
|
+
/// A map containing attributes for various devices. Each entry includes the
|
|
45
|
+
/// device's minimum and maximum screen widths, as well as the pixel ratio.
|
|
46
|
+
/// The map is divided into categories for smartphones, tablets, and
|
|
47
|
+
/// desktops/laptops.
|
|
48
|
+
///
|
|
49
|
+
/// This map contains attributes for various devices, including screen
|
|
50
|
+
/// dimensions and pixel ratios. It is structured for easy access and
|
|
51
|
+
/// modification, ensuring responsive designs that cater to a wide range
|
|
52
|
+
/// of devices.
|
|
53
|
+
///
|
|
54
|
+
/// @type Map
|
|
55
|
+
/// @access public
|
|
56
|
+
/// @property iPhones - iPhones with varying screen sizes and pixel densities.
|
|
57
|
+
///
|
|
58
|
+
/// @example scss - Usage Example
|
|
59
|
+
/// @media (min-width: map-get($devices, "iphone-x")["min-width"]) {
|
|
60
|
+
/// // Styles specific to iPhone X
|
|
61
|
+
/// }
|
|
62
|
+
///
|
|
18
63
|
$devices: (
|
|
64
|
+
|
|
65
|
+
// Phones
|
|
66
|
+
// ========================================================================
|
|
67
|
+
|
|
19
68
|
// iPhones
|
|
20
69
|
// ------------------------------------------------------------------------
|
|
21
|
-
|
|
22
|
-
"iphone-6-7-8": ("min-width": 375px, "max-width": 667px, "pixel-ratio": 2),
|
|
23
|
-
"iphone-x": ("min-width": 375px, "max-width": 812px, "pixel-ratio": 3),
|
|
24
|
-
"iphone-11": ("min-width": 414px, "max-width": 896px, "pixel-ratio": 2),
|
|
25
|
-
"iphone-12": ("min-width": 390px, "max-width": 844px, "pixel-ratio": 3),
|
|
26
|
-
"iphone-13": ("min-width": 428px, "max-width": 926px, "pixel-ratio": 3),
|
|
70
|
+
|
|
27
71
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
72
|
+
/// iPhones
|
|
73
|
+
/// iPhones with varying screen sizes and pixel densities.
|
|
74
|
+
"iphone-5": ("min-width": 320px, "max-width": 568px, "pixel-ratio": 2.0),
|
|
75
|
+
"iphone-6": ("min-width": 375px, "max-width": 667px, "pixel-ratio": 2.0),
|
|
76
|
+
"iphone-7": ("min-width": 375px, "max-width": 667px, "pixel-ratio": 2.0),
|
|
77
|
+
"iphone-8": ("min-width": 375px, "max-width": 667px, "pixel-ratio": 2.0),
|
|
78
|
+
"iphone-x": ("min-width": 375px, "max-width": 812px, "pixel-ratio": 3.0),
|
|
79
|
+
"iphone-11": ("min-width": 414px, "max-width": 896px, "pixel-ratio": 2.0),
|
|
80
|
+
"iphone-12": ("min-width": 390px, "max-width": 844px, "pixel-ratio": 3.0),
|
|
81
|
+
"iphone-13": ("min-width": 428px, "max-width": 926px, "pixel-ratio": 3.0),
|
|
34
82
|
|
|
35
83
|
// Samsung Galaxy
|
|
36
84
|
// ------------------------------------------------------------------------
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
85
|
+
|
|
86
|
+
/// iPhones
|
|
87
|
+
/// iPhones with varying screen sizes and pixel densities.
|
|
88
|
+
"samsung-s10": ("min-width": 360px, "max-width": 760px, "pixel-ratio": 3.0),
|
|
89
|
+
"samsung-s20": ("min-width": 320px, "max-width": 720px, "pixel-ratio": 4.0),
|
|
90
|
+
"samsung-s21": ("min-width": 320px, "max-width": 780px, "pixel-ratio": 3.0),
|
|
91
|
+
|
|
92
|
+
// Samsung Galaxy Fold
|
|
93
|
+
// ------------------------------------------------------------------------
|
|
94
|
+
|
|
95
|
+
/// Samsung Galaxy Fold
|
|
96
|
+
/// Samsung Galaxy Fold devices with foldable screens.
|
|
97
|
+
"galaxy-fold": ("min-width": 280px, "max-width": 653px, "pixel-ratio": 3.0),
|
|
40
98
|
|
|
41
99
|
// Google Pixel
|
|
42
100
|
// ------------------------------------------------------------------------
|
|
43
|
-
|
|
44
|
-
|
|
101
|
+
|
|
102
|
+
/// Google Pixel
|
|
103
|
+
/// Google Pixel devices with varying screen sizes and pixel densities.
|
|
104
|
+
"google-pixel": ("min-width": 411px, "max-width": 731px, "pixel-ratio": 2.6),
|
|
105
|
+
"google-pixel-5": ("min-width": 393px, "max-width": 851px, "pixel-ratio": 3.0),
|
|
45
106
|
|
|
46
|
-
|
|
107
|
+
|
|
108
|
+
/// Other Smartphones
|
|
109
|
+
/// Other popular smartphones with varying screen sizes and pixel densities.
|
|
110
|
+
"lg-g6": ("min-width": 360px, "max-width": 720px, "pixel-ratio": 4.0),
|
|
111
|
+
"oneplus-7t": ("min-width": 412px, "max-width": 732px, "pixel-ratio": 2.5),
|
|
112
|
+
"sony-xperia-1": ("min-width": 384px, "max-width": 643px, "pixel-ratio": 3.0),
|
|
113
|
+
"huawei-p30": ("min-width": 360px, "max-width": 780px, "pixel-ratio": 3.0),
|
|
114
|
+
"xiaomi-mi9": ("min-width": 393px, "max-width": 851px, "pixel-ratio": 3.0),
|
|
115
|
+
|
|
116
|
+
// Tablets
|
|
117
|
+
// ========================================================================
|
|
118
|
+
|
|
119
|
+
// iPads
|
|
47
120
|
// ------------------------------------------------------------------------
|
|
48
|
-
"surface-duo": ("min-width": 540px, "max-width": 720px, "pixel-ratio": 2.5),
|
|
49
|
-
"surface-pro": ("min-width": 768px, "max-width": 1366px, "pixel-ratio": 2),
|
|
50
121
|
|
|
51
|
-
|
|
122
|
+
|
|
123
|
+
/// iPads
|
|
124
|
+
/// Various models of Apple's iPad, including iPad, iPad Pro, iPad Mini, and iPad Air.
|
|
125
|
+
"ipad": ("min-width": 768px, "max-width": 1024px, "pixel-ratio": 2.0),
|
|
126
|
+
"ipad-pro": ("min-width": 1024px, "max-width": 1366px, "pixel-ratio": 2.0),
|
|
127
|
+
"ipad-mini": ("min-width": 768px, "max-width": 1024px, "pixel-ratio": 2.0),
|
|
128
|
+
"ipad-air": ("min-width": 820px, "max-width": 1180px, "pixel-ratio": 2.0),
|
|
129
|
+
|
|
130
|
+
// Microsoft Surface
|
|
52
131
|
// ------------------------------------------------------------------------
|
|
53
|
-
|
|
132
|
+
|
|
133
|
+
/// Microsoft Surface
|
|
134
|
+
/// Microsoft's Surface devices, including Surface Duo and Surface Pro.
|
|
135
|
+
"surface-duo": ("min-width": 540px, "max-width": 720px, "pixel-ratio": 2.5),
|
|
136
|
+
"surface-pro": ("min-width": 768px, "max-width": 1366px, "pixel-ratio": 2.0),
|
|
137
|
+
|
|
138
|
+
// Desktops & Laptops
|
|
139
|
+
// ========================================================================
|
|
54
140
|
|
|
55
|
-
//
|
|
141
|
+
// Desktops & Larger Tablets
|
|
56
142
|
// ------------------------------------------------------------------------
|
|
57
|
-
|
|
143
|
+
|
|
144
|
+
/// Desktops & Larger Tablets
|
|
145
|
+
/// Larger devices like desktops and large tablets.
|
|
146
|
+
"amazon-fire-hd": ("min-width": 800px, "max-width": 1280px, "pixel-ratio": 1.5),
|
|
58
147
|
"microsoft-laptop": ("min-width": 1504px, "max-width": 2256px, "pixel-ratio": 1.5),
|
|
59
|
-
|
|
60
|
-
//
|
|
148
|
+
|
|
149
|
+
// Mac Devices
|
|
61
150
|
// ------------------------------------------------------------------------
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
151
|
+
|
|
152
|
+
/// Mac Devices
|
|
153
|
+
/// Various Apple Mac devices, including MacBook Air, MacBook Pro, and iMac.
|
|
154
|
+
"macbook-air": ("min-width": 1440px, "max-width": 2560px, "pixel-ratio": 2.0),
|
|
155
|
+
"macbook-pro": ("min-width": 1680px, "max-width": 3072px, "pixel-ratio": 2.0),
|
|
156
|
+
"imac": ("min-width": 1920px, "max-width": 5120px, "pixel-ratio": 2.0),
|
|
65
157
|
|
|
66
158
|
// Additional Devices
|
|
67
159
|
// ------------------------------------------------------------------------
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
"
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
);
|
|
160
|
+
|
|
161
|
+
/// Other Laptops
|
|
162
|
+
/// Other popular laptops, including Surface Book, Dell XPS, and Lenovo ThinkPad.
|
|
163
|
+
"surface-book": ("min-width": 1500px, "max-width": 2000px, "pixel-ratio": 2.0),
|
|
164
|
+
"dell-xps": ("min-width": 1920px, "max-width": 3840px, "pixel-ratio": 2.0),
|
|
165
|
+
"lenovo-thinkpad": ("min-width": 1440px, "max-width": 2560px, "pixel-ratio": 2.0)
|
|
166
|
+
|
|
167
|
+
);
|
|
@@ -1,31 +1,99 @@
|
|
|
1
|
-
//
|
|
1
|
+
// ============================================================================
|
|
2
|
+
// Poster
|
|
3
|
+
// ============================================================================
|
|
2
4
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
5
|
+
////
|
|
6
|
+
///
|
|
7
|
+
/// Variables Module
|
|
8
|
+
/// ===========================================================================
|
|
9
|
+
///
|
|
10
|
+
/// This module consolidates and forwards SCSS partials that define variables
|
|
11
|
+
/// for consistent use throughout the project. Each forwarded file encapsulates
|
|
12
|
+
/// a specific category of variables, ensuring modularity, clarity, and ease of
|
|
13
|
+
/// maintenance.
|
|
14
|
+
///
|
|
15
|
+
/// Forwarded Modules Overview:
|
|
16
|
+
/// - `layer`: Variables related to layout layers and z-indexing.
|
|
17
|
+
/// - `paper`: Defines color palettes, textures, and backgrounds.
|
|
18
|
+
/// - `unit`: Measurement units, spacing, and size-related variables.
|
|
19
|
+
/// - `scale`: Scaling factors for typography and responsive elements.
|
|
20
|
+
/// - `view`: Variables tied to viewport-specific breakpoints.
|
|
21
|
+
/// - `device`: Device-specific configurations to enhance responsive design.
|
|
22
|
+
/// - `color`: Centralized color definitions for consistent theming.
|
|
23
|
+
/// - `ratio`: Aspect ratio configurations for responsive elements.
|
|
24
|
+
///
|
|
25
|
+
/// @group Variables
|
|
26
|
+
/// @author Scape Agency
|
|
27
|
+
/// @link https://unit.gl
|
|
28
|
+
/// @since 0.1.0 initial release
|
|
29
|
+
/// @todo None
|
|
30
|
+
/// @access public
|
|
31
|
+
///
|
|
32
|
+
////
|
|
6
33
|
|
|
7
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
34
|
|
|
9
|
-
//
|
|
10
|
-
//
|
|
11
|
-
//
|
|
12
|
-
// See the License for the specific language governing permissions and
|
|
13
|
-
// limitations under the License.
|
|
35
|
+
// ============================================================================
|
|
36
|
+
// Use
|
|
37
|
+
// ============================================================================
|
|
14
38
|
|
|
15
39
|
|
|
16
40
|
// ============================================================================
|
|
17
|
-
//
|
|
41
|
+
// Forward
|
|
18
42
|
// ============================================================================
|
|
19
43
|
|
|
20
|
-
|
|
44
|
+
|
|
45
|
+
///
|
|
46
|
+
/// Forwards variables related to layout layers and z-indexing, ensuring
|
|
47
|
+
/// consistent layering and stacking order throughout the project.
|
|
48
|
+
///
|
|
49
|
+
@forward "layer"; // Layout layers and z-index variables
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
///
|
|
53
|
+
/// Forwards variables defining paper sizes etc.
|
|
54
|
+
///
|
|
21
55
|
@forward "paper";
|
|
22
56
|
|
|
23
57
|
|
|
58
|
+
///
|
|
59
|
+
/// Forwards variables managing scaling factors for typography and responsive
|
|
60
|
+
/// elements, ensuring that elements scale proportionally across different
|
|
61
|
+
/// viewports.
|
|
62
|
+
///
|
|
63
|
+
@forward "scale"; // Typography scaling and responsive element sizing
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
///
|
|
67
|
+
/// Forwards viewport-specific variables, such as breakpoints, to facilitate
|
|
68
|
+
/// responsive design practices.
|
|
69
|
+
///
|
|
70
|
+
@forward "view"; // Viewport-specific variables and breakpoints
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
///
|
|
74
|
+
/// Forwards device-specific configurations that aid in creating responsive
|
|
75
|
+
/// designs tailored to various devices.
|
|
76
|
+
///
|
|
77
|
+
@forward "device"; // Device-specific responsive design variables
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
///
|
|
81
|
+
/// Forwards centralized color definitions, providing a consistent color scheme
|
|
82
|
+
/// across the project.
|
|
83
|
+
///
|
|
84
|
+
@forward "color"; // Centralized color definitions for the project
|
|
24
85
|
|
|
25
|
-
@forward "unit";
|
|
26
86
|
|
|
27
|
-
|
|
87
|
+
///
|
|
88
|
+
/// Forwards aspect ratio configurations that ensure responsive elements
|
|
89
|
+
/// maintain their intended proportions across different devices and viewports.
|
|
90
|
+
///
|
|
91
|
+
@forward "ratio"; // Aspect ratio configurations for responsive elements
|
|
28
92
|
|
|
29
|
-
|
|
93
|
+
///
|
|
94
|
+
/// Forwards variables related to measurement units, spacing, and size
|
|
95
|
+
/// definitions. Useful for maintaining consistent sizing across different
|
|
96
|
+
/// components.
|
|
97
|
+
///
|
|
98
|
+
@forward "unit"; // Measurement units and spacing
|
|
30
99
|
|
|
31
|
-
@forward "device";
|
|
@@ -1,58 +1,155 @@
|
|
|
1
|
-
//
|
|
2
|
-
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
// ============================================================================
|
|
2
|
+
// Poster
|
|
3
|
+
// ============================================================================
|
|
4
|
+
|
|
5
|
+
////
|
|
6
|
+
///
|
|
7
|
+
/// Layer Variables Module
|
|
8
|
+
/// ===========================================================================
|
|
9
|
+
///
|
|
10
|
+
/// @group Layer
|
|
11
|
+
/// @author Scape Agency
|
|
12
|
+
/// @link https://unit.gl
|
|
13
|
+
/// @since 0.1.0 initial release
|
|
14
|
+
/// @todo None
|
|
15
|
+
/// @access public
|
|
16
|
+
///
|
|
17
|
+
////
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
// ============================================================================
|
|
21
|
+
// Use
|
|
22
|
+
// ============================================================================
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
// ============================================================================
|
|
26
|
+
// Variables
|
|
27
|
+
// ============================================================================
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
///
|
|
31
|
+
/// Z-Index Layer Map
|
|
32
|
+
/// ---------------------------------------------------------------------------
|
|
33
|
+
///
|
|
34
|
+
/// A map defining the z-index layers used to manage the stacking order of UI
|
|
35
|
+
/// elements. Each key in the map represents a specific layer, with an
|
|
36
|
+
/// associated numeric value indicating its z-index.
|
|
37
|
+
///
|
|
38
|
+
/// This map defines the z-index layers used throughout the project to manage
|
|
39
|
+
/// the stacking order of various interface elements. Adjustments can be made
|
|
40
|
+
/// by modifying the values associated with each layer.
|
|
41
|
+
///
|
|
42
|
+
/// - **Guides**: High-priority overlays for design guides.
|
|
43
|
+
/// - **Overlays**: Elements like modals that need to appear above other content.
|
|
44
|
+
/// - **Interface Elements**: General UI components, ribbons, and controls.
|
|
45
|
+
/// - **Content**: Main content areas, typically stacked below UI elements.
|
|
46
|
+
/// - **Background Layers**: Base layers like canvases, typically behind content.
|
|
47
|
+
/// - **Special Values**: Special z-index values for maximum, minimum, and baseline.
|
|
48
|
+
///
|
|
49
|
+
/// @name layers
|
|
50
|
+
/// @type Map
|
|
51
|
+
///
|
|
52
|
+
/// @example scss - Usage Example
|
|
53
|
+
/// .element {
|
|
54
|
+
/// z-index: z('modal');
|
|
55
|
+
/// }
|
|
56
|
+
///
|
|
57
|
+
/// @todo Add more layers as needed, ensuring consistent and clear naming.
|
|
58
|
+
///
|
|
19
59
|
$layers: (
|
|
20
60
|
|
|
61
|
+
// ========================================================================
|
|
21
62
|
// Guides
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
63
|
+
// ========================================================================
|
|
64
|
+
|
|
65
|
+
/// High-priority guide overlays for design and debugging.
|
|
66
|
+
/// @name guides
|
|
67
|
+
/// @type Number
|
|
68
|
+
"guides": 9998, // High priority guide overlays
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
/// Baseline guide used for text alignment and visual rhythm.
|
|
72
|
+
/// @name guide_baseline
|
|
73
|
+
/// @type Number
|
|
74
|
+
"guide_baseline": 3000, // Baseline guide for text alignment
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
/// Graphical guides, such as grid overlays, used in design.
|
|
78
|
+
/// @name guide_graph
|
|
79
|
+
/// @type Number
|
|
80
|
+
"guide_graph": 3100, // Graphical guides, such as grids
|
|
81
|
+
|
|
82
|
+
// ========================================================================
|
|
26
83
|
// Overlays
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
84
|
+
// ========================================================================
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
/// Z-index for modals and dialog boxes, ensuring they appear above other content.
|
|
88
|
+
/// @name modal
|
|
89
|
+
/// @type Number
|
|
90
|
+
"modal": 7000, // Modals and dialog boxes
|
|
91
|
+
|
|
92
|
+
// ========================================================================
|
|
93
|
+
// Interface Elements
|
|
94
|
+
// ========================================================================
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
/// Z-index for top ribbons and banners that overlay other UI elements.
|
|
98
|
+
/// @name ribbon
|
|
99
|
+
/// @type Number
|
|
100
|
+
"ribbon": 5000, // Top ribbons, banners
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
/// General interface elements like headers, footers, and sidebars.
|
|
104
|
+
/// @name interface
|
|
105
|
+
/// @type Number
|
|
106
|
+
"interface": 4000, // General interface elements
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
/// Controls like buttons, sliders, and other interactive elements.
|
|
110
|
+
/// @name control
|
|
111
|
+
/// @type Number
|
|
112
|
+
"control": 3000, // Controls like buttons, sliders
|
|
113
|
+
|
|
114
|
+
// ========================================================================
|
|
34
115
|
// Content
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
//
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
116
|
+
// ========================================================================
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
/// Main content area, typically stacked below UI elements.
|
|
120
|
+
/// @name content
|
|
121
|
+
/// @type Number
|
|
122
|
+
"content": 2000, // Main content area
|
|
123
|
+
|
|
124
|
+
// ========================================================================
|
|
125
|
+
// Background Layers
|
|
126
|
+
// ========================================================================
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
/// Background canvas or base layer, typically the lowest layer.
|
|
130
|
+
/// @name canvas
|
|
131
|
+
/// @type Number
|
|
132
|
+
"canvas": -1000, // Background canvas or base layer
|
|
133
|
+
|
|
134
|
+
// ========================================================================
|
|
135
|
+
// Special Values
|
|
136
|
+
// ========================================================================
|
|
137
|
+
|
|
138
|
+
/// Maximum possible z-index value.
|
|
139
|
+
/// @name max
|
|
140
|
+
/// @type Number
|
|
141
|
+
"max": 9999, // Maximum possible z-index
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
/// Default, baseline z-index value.
|
|
145
|
+
/// @name mid
|
|
146
|
+
/// @type Number
|
|
147
|
+
"mid": 0, // Default, baseline z-index
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
/// Minimum possible z-index value.
|
|
151
|
+
/// @name min
|
|
152
|
+
/// @type Number
|
|
153
|
+
"min":m-9999, // Minimum possible z-index
|
|
47
154
|
|
|
48
155
|
) !default;
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
/// Layer Function
|
|
52
|
-
/// Retrieve z-index from the layers map
|
|
53
|
-
@function z($layer) {
|
|
54
|
-
@if not map-has-key($layers, $layer) {
|
|
55
|
-
@warn "No layer found for `#{$layer}` in $z-layers map. Property omitted.";
|
|
56
|
-
}
|
|
57
|
-
@return map-get($layers, $layer);
|
|
58
|
-
}
|