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.
- package/css/unit.gl.css +253 -122
- package/css/unit.gl.min.css +1 -1
- package/js/grids.js +59 -0
- package/js/grids.js.map +1 -0
- package/js/unit.gl.js +10 -0
- package/js/unit.gl.js.map +1 -0
- package/package.json +1 -1
- package/scss/_reset.scss +15 -1
- package/scss/classes/_guide.scss +56 -54
- package/scss/classes/_index.scss +1 -5
- package/scss/classes/_ratio.scss +56 -6
- package/scss/dev/_banner.scss +0 -4
- package/scss/functions/_color.scss +1 -5
- package/scss/functions/_index.scss +0 -4
- package/scss/functions/_layer.scss +3 -6
- package/scss/functions/_ratio.scss +2 -5
- package/scss/functions/_scale.scss +8 -14
- package/scss/functions/_sequence.scss +0 -5
- package/scss/functions/_view.scss +0 -4
- package/scss/functions/math/_arithmetic.scss +12 -10
- package/scss/functions/math/_index.scss +0 -4
- package/scss/functions/unit/_index.scss +0 -4
- package/scss/functions/unit/_unit_conversion.scss +6 -30
- package/scss/functions/unit/_unit_functions.scss +2 -16
- package/scss/index.scss +12 -1
- package/scss/maps/_color.scss +1 -5
- package/scss/{variables → maps}/_device.scss +78 -73
- package/scss/maps/_index.scss +36 -5
- package/scss/{variables/_ratio.scss → maps/_interval.scss} +1 -6
- package/scss/{variables → maps}/_layer.scss +24 -20
- package/scss/{variables → maps}/_paper.scss +613 -414
- package/scss/maps/_ratio.scss +76 -0
- package/scss/maps/_scale.scss +82 -0
- package/scss/mixins/_device.scss +11 -8
- package/scss/mixins/_display.scss +35 -72
- package/scss/mixins/_guide.scss +151 -43
- package/scss/mixins/_helper.scss +2 -6
- package/scss/mixins/_index.scss +0 -4
- package/scss/mixins/_paper.scss +3 -7
- package/scss/mixins/_ratio.scss +79 -238
- package/scss/mixins/_unit.scss +1 -10
- package/scss/mixins/_view.scss +1 -5
- package/scss/tags/_index.scss +0 -4
- package/scss/tags/_unit.scss +0 -4
- package/scss/test.scss +0 -0
- package/scss/variables/_color.scss +7 -7
- package/scss/variables/_guide.scss +0 -0
- package/scss/variables/_index.scss +6 -40
- package/scss/variables/_scale.scss +4 -89
- package/scss/variables/_unit.scss +2 -5
- package/scss/variables/_view.scss +2 -7
- package/ts/grids.ts +92 -0
- package/ts/index.ts +19 -1
- package/scss/classes/_guides.scss +0 -141
- package/ts/AspectRatio.ts +0 -50
- package/ts/Border.ts +0 -60
- package/ts/BoxModel.ts +0 -68
- package/ts/FlexContainer.ts +0 -75
- package/ts/Grid.ts +0 -46
- package/ts/GridContainer.ts +0 -59
- package/ts/Layout.ts +0 -64
- package/ts/Position.ts +0 -53
- package/ts/Rectangle.ts +0 -51
- package/ts/ResponsiveImage.ts +0 -47
- package/ts/ResponsiveScale.ts +0 -44
- package/ts/Size.ts +0 -54
- package/ts/Spacing.ts +0 -106
- package/ts/Transform.ts +0 -71
- package/ts/Typography.ts +0 -75
- package/ts/Unit.ts +0 -81
- package/ts/Viewport.ts +0 -52
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
////
|
|
2
|
+
///
|
|
3
|
+
/// Ratio Maps Module
|
|
4
|
+
/// ===========================================================================
|
|
5
|
+
///
|
|
6
|
+
/// Defines a map of commonly used aspect ratios, used to generate both
|
|
7
|
+
/// mixins and utility classes. Each key is a string representing the ratio,
|
|
8
|
+
/// and each value is a 2-item list of width and height values.
|
|
9
|
+
///
|
|
10
|
+
/// @group Ratio
|
|
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
|
+
// Maps
|
|
21
|
+
// ============================================================================
|
|
22
|
+
|
|
23
|
+
$ratio_map: (
|
|
24
|
+
1x1: (
|
|
25
|
+
1,
|
|
26
|
+
1
|
|
27
|
+
),
|
|
28
|
+
1x2: (
|
|
29
|
+
1,
|
|
30
|
+
2
|
|
31
|
+
),
|
|
32
|
+
2x1: (
|
|
33
|
+
2,
|
|
34
|
+
1
|
|
35
|
+
),
|
|
36
|
+
1x3: (
|
|
37
|
+
1,
|
|
38
|
+
3
|
|
39
|
+
),
|
|
40
|
+
3x1: (
|
|
41
|
+
3,
|
|
42
|
+
1
|
|
43
|
+
),
|
|
44
|
+
1x4: (
|
|
45
|
+
1,
|
|
46
|
+
4
|
|
47
|
+
),
|
|
48
|
+
4x1: (
|
|
49
|
+
4,
|
|
50
|
+
1
|
|
51
|
+
),
|
|
52
|
+
3x2: (
|
|
53
|
+
3,
|
|
54
|
+
2
|
|
55
|
+
),
|
|
56
|
+
2x3: (
|
|
57
|
+
2,
|
|
58
|
+
3
|
|
59
|
+
),
|
|
60
|
+
4x3: (
|
|
61
|
+
4,
|
|
62
|
+
3
|
|
63
|
+
),
|
|
64
|
+
3x4: (
|
|
65
|
+
3,
|
|
66
|
+
4
|
|
67
|
+
),
|
|
68
|
+
16x9: (
|
|
69
|
+
16,
|
|
70
|
+
9
|
|
71
|
+
),
|
|
72
|
+
16x10: (
|
|
73
|
+
16,
|
|
74
|
+
10
|
|
75
|
+
)
|
|
76
|
+
) !default;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// Musical Scales Map
|
|
3
|
+
/// ---------------------------------------------------------------------------
|
|
4
|
+
///
|
|
5
|
+
/// A map representing various musical scales by their degree.
|
|
6
|
+
/// These scales can be used to inform design decisions, such as rhythm-based
|
|
7
|
+
/// spacing or modular scale ratios in typography.
|
|
8
|
+
///
|
|
9
|
+
/// @name scale_musical
|
|
10
|
+
/// @type Map
|
|
11
|
+
///
|
|
12
|
+
$scale_musical: (
|
|
13
|
+
"monotonic": 1,
|
|
14
|
+
// Single tone scale
|
|
15
|
+
"ditonic": 2,
|
|
16
|
+
// Two-tone scale
|
|
17
|
+
"tritonic": 3,
|
|
18
|
+
// Three-tone scale
|
|
19
|
+
"tetratonic": 4,
|
|
20
|
+
// Four-tone scale
|
|
21
|
+
"pentatonic": 5,
|
|
22
|
+
// Five-tone scale, commonly used in music
|
|
23
|
+
"hexatonic": 6,
|
|
24
|
+
// Six-tone scale
|
|
25
|
+
"peptatonic": 7,
|
|
26
|
+
// Seven-tone scale
|
|
27
|
+
"octatonic": 8,
|
|
28
|
+
// Eight-tone scale
|
|
29
|
+
"nonatonic": 9,
|
|
30
|
+
// Nine-tone scale
|
|
31
|
+
"dodecatonic": 12,
|
|
32
|
+
// Twelve-tone scale, covers all semitones in an octave
|
|
33
|
+
) !default;
|
|
34
|
+
|
|
35
|
+
/// Classic Typographic Scale
|
|
36
|
+
/// ---------------------------------------------------------------------------
|
|
37
|
+
///
|
|
38
|
+
/// A classic typographic scale that has historical significance,
|
|
39
|
+
/// often used in design software and by typographers since the Renaissance.
|
|
40
|
+
/// This scale ensures harmonious and aesthetically pleasing text sizing.
|
|
41
|
+
///
|
|
42
|
+
/// @name typographic_scale_classic
|
|
43
|
+
/// @type Map
|
|
44
|
+
///
|
|
45
|
+
$typographic_scale_classic: (
|
|
46
|
+
1: q(6),
|
|
47
|
+
// 6q
|
|
48
|
+
2: q(7),
|
|
49
|
+
// 7q (+1)
|
|
50
|
+
3: q(8),
|
|
51
|
+
// 8q (+1)
|
|
52
|
+
4: q(9),
|
|
53
|
+
// 9q (+1)
|
|
54
|
+
5: q(10),
|
|
55
|
+
// 10q (+1)
|
|
56
|
+
6: q(11),
|
|
57
|
+
// 11q (+1)
|
|
58
|
+
7: q(12),
|
|
59
|
+
// 12q (+1)
|
|
60
|
+
8: q(14),
|
|
61
|
+
// 14q (+2)
|
|
62
|
+
9: q(16),
|
|
63
|
+
// 16q (+2)
|
|
64
|
+
10: q(18),
|
|
65
|
+
// 18q (+2)
|
|
66
|
+
11: q(21),
|
|
67
|
+
// 21q (+3)
|
|
68
|
+
12: q(24),
|
|
69
|
+
// 24q (+3)
|
|
70
|
+
13: q(36),
|
|
71
|
+
// 36q (+12)
|
|
72
|
+
14: q(48),
|
|
73
|
+
// 48q (+12)
|
|
74
|
+
15: q(60),
|
|
75
|
+
// 60q (+12)
|
|
76
|
+
16: q(72),
|
|
77
|
+
// 72q (+12)
|
|
78
|
+
17: q(84),
|
|
79
|
+
// 84q (+12)
|
|
80
|
+
18: q(96),
|
|
81
|
+
// 96q (+12)
|
|
82
|
+
) !default;
|
package/scss/mixins/_device.scss
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
// ============================================================================
|
|
2
|
-
// Poster
|
|
3
|
-
// ============================================================================
|
|
4
|
-
|
|
5
1
|
////
|
|
6
2
|
///
|
|
7
3
|
/// Device Mixins Module
|
|
8
4
|
/// ===========================================================================
|
|
9
5
|
///
|
|
6
|
+
/// @file _device.scss
|
|
7
|
+
/// @title Device Mixins Module
|
|
8
|
+
/// @version 0.1.0
|
|
9
|
+
/// @description Provides responsive media query mixins based on device profiles.
|
|
10
|
+
/// These mixins simplify writing device-specific styles using a
|
|
11
|
+
/// centralized configuration map.
|
|
12
|
+
///
|
|
10
13
|
/// @group Device
|
|
11
14
|
/// @author Scape Agency
|
|
12
15
|
/// @link https://unit.gl
|
|
@@ -43,7 +46,7 @@
|
|
|
43
46
|
///
|
|
44
47
|
@mixin device_media_query($device) {
|
|
45
48
|
// Retrieve the device attributes from the $devices map
|
|
46
|
-
$attributes: map
|
|
49
|
+
$attributes: map.get($devices, $device);
|
|
47
50
|
|
|
48
51
|
// Validate that the device exists in the $devices map
|
|
49
52
|
@if $attributes == null {
|
|
@@ -52,9 +55,9 @@
|
|
|
52
55
|
}
|
|
53
56
|
|
|
54
57
|
// Extract individual attributes with default fallbacks
|
|
55
|
-
$min-width: map
|
|
56
|
-
$max-width: map
|
|
57
|
-
$pixel-ratio: map
|
|
58
|
+
$min-width: map.get($attributes, "min-width");
|
|
59
|
+
$max-width: map.get($attributes, "max-width");
|
|
60
|
+
$pixel-ratio: map.get($attributes, "pixel-ratio", 1); // Default to 1
|
|
58
61
|
|
|
59
62
|
// Construct the media query string
|
|
60
63
|
$media-query: "only screen";
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
// ============================================================================
|
|
2
|
-
// Poster
|
|
3
|
-
// ============================================================================
|
|
4
|
-
|
|
5
1
|
////
|
|
6
2
|
///
|
|
7
3
|
/// Display Mixins Module
|
|
@@ -35,16 +31,14 @@
|
|
|
35
31
|
// ============================================================================
|
|
36
32
|
|
|
37
33
|
///
|
|
38
|
-
/// Applies styles
|
|
39
|
-
/// minimum width can be specified to target specific breakpoints.
|
|
34
|
+
/// Applies styles in landscape orientation, optionally above a min-width.
|
|
40
35
|
///
|
|
41
|
-
/// @
|
|
42
|
-
/// @param {Length} $min-width (optional) - The minimum width at which the styles should apply.
|
|
36
|
+
/// @param {Length|null} $min-width - Optional breakpoint to combine with orientation
|
|
43
37
|
///
|
|
44
|
-
/// @example scss
|
|
45
|
-
///
|
|
46
|
-
///
|
|
47
|
-
///
|
|
38
|
+
/// @example scss
|
|
39
|
+
/// @include display_orientation_landscape(1024px) {
|
|
40
|
+
/// // styles for landscape on screens wider than 1024px
|
|
41
|
+
/// }
|
|
48
42
|
///
|
|
49
43
|
@mixin display_orientation_landscape($min-width: null) {
|
|
50
44
|
@if $min-width {
|
|
@@ -53,26 +47,20 @@
|
|
|
53
47
|
}
|
|
54
48
|
} @else {
|
|
55
49
|
@media (orientation: landscape) {
|
|
56
|
-
// The styles inside this mixin are applied in landscape mode
|
|
57
50
|
@content;
|
|
58
51
|
}
|
|
59
52
|
}
|
|
60
53
|
}
|
|
61
54
|
|
|
62
55
|
///
|
|
63
|
-
///
|
|
64
|
-
/// ---------------------------------------------------------------------------
|
|
56
|
+
/// Applies styles in portrait orientation, optionally above a min-width.
|
|
65
57
|
///
|
|
66
|
-
///
|
|
67
|
-
/// minimum width can be specified to target specific breakpoints.
|
|
58
|
+
/// @param {Length|null} $min-width - Optional breakpoint to combine with orientation
|
|
68
59
|
///
|
|
69
|
-
/// @
|
|
70
|
-
///
|
|
71
|
-
///
|
|
72
|
-
///
|
|
73
|
-
/// @include display-orientation-portrait(768px) {
|
|
74
|
-
/// // Styles for portrait orientation and min-width 768px
|
|
75
|
-
/// }
|
|
60
|
+
/// @example scss
|
|
61
|
+
/// @include display_orientation_portrait(768px) {
|
|
62
|
+
/// // styles for portrait on screens wider than 768px
|
|
63
|
+
/// }
|
|
76
64
|
///
|
|
77
65
|
@mixin display_orientation_portrait($min-width: null) {
|
|
78
66
|
@if $min-width {
|
|
@@ -87,60 +75,35 @@
|
|
|
87
75
|
}
|
|
88
76
|
|
|
89
77
|
///
|
|
90
|
-
///
|
|
91
|
-
///
|
|
92
|
-
///
|
|
93
|
-
/// Targets high-density displays, such as Retina screens, using various
|
|
94
|
-
/// methods to ensure broad compatibility across devices.
|
|
95
|
-
///
|
|
96
|
-
/// @name display_retina
|
|
78
|
+
/// Applies styles on high-density (Retina) displays.
|
|
79
|
+
/// Targets modern and older syntax for broad support.
|
|
97
80
|
///
|
|
98
|
-
/// @example scss
|
|
99
|
-
/// @include
|
|
100
|
-
/// //
|
|
81
|
+
/// @example scss
|
|
82
|
+
/// @include display_retina {
|
|
83
|
+
/// // high-resolution styles
|
|
101
84
|
/// }
|
|
102
85
|
///
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
// }
|
|
86
|
+
@mixin display_retina {
|
|
87
|
+
@media (-webkit-min-device-pixel-ratio: 2),
|
|
88
|
+
(min-resolution: 192dpi),
|
|
89
|
+
(min-resolution: 2dppx) {
|
|
90
|
+
@content;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
111
93
|
|
|
112
94
|
///
|
|
113
|
-
///
|
|
114
|
-
/// ---------------------------------------------------------------------------
|
|
95
|
+
/// Applies styles when the screen matches a specific aspect ratio.
|
|
115
96
|
///
|
|
116
|
-
///
|
|
117
|
-
///
|
|
118
|
-
/// aspect ratio, ensuring that your design adapts perfectly to
|
|
119
|
-
/// screens of varying shapes and sizes.
|
|
97
|
+
/// @param {Number} $width - The horizontal component of the aspect ratio
|
|
98
|
+
/// @param {Number} $height - The vertical component of the aspect ratio
|
|
120
99
|
///
|
|
121
|
-
/// @
|
|
122
|
-
///
|
|
123
|
-
///
|
|
124
|
-
///
|
|
125
|
-
/// @example scss - Basic Usage
|
|
126
|
-
/// @include aspect_ratio(16, 9) {
|
|
127
|
-
/// // Styles for devices with a 16:9 aspect ratio
|
|
128
|
-
/// .video {
|
|
129
|
-
/// max-width: 100%;
|
|
130
|
-
/// }
|
|
100
|
+
/// @example scss
|
|
101
|
+
/// @include display_ratio(16, 9) {
|
|
102
|
+
/// // styles for 16:9 screens
|
|
131
103
|
/// }
|
|
132
104
|
///
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
/// padding: 20px;
|
|
139
|
-
/// }
|
|
140
|
-
/// }
|
|
141
|
-
///
|
|
142
|
-
// @mixin display_ratio($width, $height) {
|
|
143
|
-
// @media (aspect-ratio: #{$width} / #{$height}) {
|
|
144
|
-
// @content;
|
|
145
|
-
// }
|
|
146
|
-
// }
|
|
105
|
+
@mixin display_ratio($width, $height) {
|
|
106
|
+
@media (aspect-ratio: #{ $width / $height }) {
|
|
107
|
+
@content;
|
|
108
|
+
}
|
|
109
|
+
}
|
package/scss/mixins/_guide.scss
CHANGED
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
// ============================================================================
|
|
2
|
-
// Poster
|
|
3
|
-
// ============================================================================
|
|
4
|
-
|
|
5
1
|
////
|
|
6
2
|
///
|
|
7
3
|
/// Guide Mixins Module
|
|
@@ -24,6 +20,9 @@
|
|
|
24
20
|
// Use
|
|
25
21
|
// ============================================================================
|
|
26
22
|
|
|
23
|
+
@use "sass:map";
|
|
24
|
+
@use "sass:meta";
|
|
25
|
+
|
|
27
26
|
@use "../functions" as *;
|
|
28
27
|
@use "../variables" as *;
|
|
29
28
|
@use "../maps" as *;
|
|
@@ -47,18 +46,52 @@
|
|
|
47
46
|
/// }
|
|
48
47
|
///
|
|
49
48
|
@mixin guide {
|
|
50
|
-
z-index: z("guides");
|
|
51
|
-
//
|
|
52
|
-
// z-index: $z-index;
|
|
49
|
+
z-index: if(meta.function-exists("z"), z("guides"), 9999);
|
|
50
|
+
// z-index: z("guides");
|
|
53
51
|
position: absolute;
|
|
52
|
+
// position: fixed;
|
|
54
53
|
top: 0;
|
|
55
54
|
left: 0;
|
|
55
|
+
// width: 100vw;
|
|
56
|
+
// height: 100vh;
|
|
56
57
|
width: 100%;
|
|
57
58
|
height: 100%;
|
|
58
59
|
margin: 0;
|
|
59
60
|
pointer-events: none;
|
|
60
|
-
opacity:
|
|
61
|
-
|
|
61
|
+
opacity: 1;
|
|
62
|
+
|
|
63
|
+
background-attachment: local;
|
|
64
|
+
|
|
65
|
+
&.is-hidden {
|
|
66
|
+
display: none !important;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
///
|
|
71
|
+
/// Centered Guide Mixin
|
|
72
|
+
/// ---------------------------------------------------------------------------
|
|
73
|
+
///
|
|
74
|
+
/// Creates a centered guide box useful for ensuring elements are
|
|
75
|
+
/// aligned to the center of the viewport.
|
|
76
|
+
///
|
|
77
|
+
/// @name guide_centered
|
|
78
|
+
/// @param {Length} $width - The width of the centered guide box.
|
|
79
|
+
/// @param {Length} $height - The height of the centered guide box.
|
|
80
|
+
/// @param {Color} $color - The color of the guide box border. Defaults to red.
|
|
81
|
+
///
|
|
82
|
+
/// @example scss - Usage
|
|
83
|
+
/// .guide_centered {
|
|
84
|
+
/// @include guide_centered(100px, 100px, red);
|
|
85
|
+
/// }
|
|
86
|
+
///
|
|
87
|
+
@mixin guide_centered($width, $height, $color: red) {
|
|
88
|
+
@include guide;
|
|
89
|
+
width: $width;
|
|
90
|
+
height: $height;
|
|
91
|
+
top: 50%;
|
|
92
|
+
left: 50%;
|
|
93
|
+
transform: translate(-50%, -50%);
|
|
94
|
+
border: 2px solid $color;
|
|
62
95
|
}
|
|
63
96
|
|
|
64
97
|
///
|
|
@@ -77,17 +110,103 @@
|
|
|
77
110
|
/// @include guide_graph(10px, #ccc);
|
|
78
111
|
/// }
|
|
79
112
|
///
|
|
80
|
-
@mixin guide_graph(
|
|
113
|
+
@mixin guide_graph(
|
|
114
|
+
$column_width: baseline(4),
|
|
115
|
+
$row_height: baseline(4),
|
|
116
|
+
$column_color: $guide_graph_primary,
|
|
117
|
+
$baseline_color: $guide_graph_primary
|
|
118
|
+
) {
|
|
81
119
|
@include guide;
|
|
82
|
-
|
|
120
|
+
|
|
121
|
+
background-repeat: repeat;
|
|
122
|
+
background-size: $column_width $row_height;
|
|
123
|
+
|
|
83
124
|
background-image: repeating-linear-gradient(
|
|
125
|
+
to right,
|
|
126
|
+
$column_color 0,
|
|
127
|
+
$column_color 1px,
|
|
128
|
+
transparent 1px,
|
|
129
|
+
transparent $column_width
|
|
130
|
+
),
|
|
131
|
+
repeating-linear-gradient(
|
|
84
132
|
to bottom,
|
|
85
|
-
$
|
|
86
|
-
|
|
133
|
+
$baseline_color 0,
|
|
134
|
+
$baseline_color 1px,
|
|
135
|
+
transparent 1px,
|
|
136
|
+
transparent $row_height
|
|
137
|
+
);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
@mixin guide_graph_centered(
|
|
141
|
+
$columns: 12,
|
|
142
|
+
$column_width: baseline(4),
|
|
143
|
+
$row_height: baseline(4),
|
|
144
|
+
$column_color: $guide_graph_primary,
|
|
145
|
+
$baseline_color: $guide_graph_primary
|
|
146
|
+
) {
|
|
147
|
+
@include guide;
|
|
148
|
+
|
|
149
|
+
background-repeat: repeat;
|
|
150
|
+
background-size: $column_width $row_height;
|
|
151
|
+
|
|
152
|
+
// Offset grid so center column lands in center of screen
|
|
153
|
+
$total_grid_width: $columns * $column_width;
|
|
154
|
+
$half_offset: calc(50% - (#{$total_grid_width} / 2));
|
|
155
|
+
|
|
156
|
+
background-position: $half_offset 0;
|
|
157
|
+
|
|
158
|
+
background-image: repeating-linear-gradient(
|
|
159
|
+
to right,
|
|
160
|
+
$column_color 0,
|
|
161
|
+
$column_color 1px,
|
|
162
|
+
transparent 1px,
|
|
163
|
+
transparent $column_width
|
|
87
164
|
),
|
|
88
|
-
repeating-linear-gradient(
|
|
165
|
+
repeating-linear-gradient(
|
|
166
|
+
to bottom,
|
|
167
|
+
$baseline_color 0,
|
|
168
|
+
$baseline_color 1px,
|
|
169
|
+
transparent 1px,
|
|
170
|
+
transparent $row_height
|
|
171
|
+
);
|
|
89
172
|
}
|
|
90
173
|
|
|
174
|
+
// @mixin guide_graph_centered(
|
|
175
|
+
// $content_width: 200%,
|
|
176
|
+
// $column_width: baseline(4),
|
|
177
|
+
// $row_height: baseline(4),
|
|
178
|
+
// $column_color: $guide_graph_primary,
|
|
179
|
+
// $baseline_color: $guide_graph_primary
|
|
180
|
+
// ) {
|
|
181
|
+
// @include guide;
|
|
182
|
+
|
|
183
|
+
// // Centered horizontal layout
|
|
184
|
+
// width: $content_width;
|
|
185
|
+
// max-width: none;
|
|
186
|
+
// left: 50%;
|
|
187
|
+
// transform: translateX(-50%);
|
|
188
|
+
|
|
189
|
+
// // Let JavaScript dynamically adjust full height
|
|
190
|
+
// min-height: 100vh;
|
|
191
|
+
// background-repeat: repeat;
|
|
192
|
+
// background-size: $column_width $row_height;
|
|
193
|
+
|
|
194
|
+
// background-image: repeating-linear-gradient(
|
|
195
|
+
// to right,
|
|
196
|
+
// $column_color 0,
|
|
197
|
+
// $column_color 1px,
|
|
198
|
+
// transparent 1px,
|
|
199
|
+
// transparent $column_width
|
|
200
|
+
// ),
|
|
201
|
+
// repeating-linear-gradient(
|
|
202
|
+
// to bottom,
|
|
203
|
+
// $baseline_color 0,
|
|
204
|
+
// $baseline_color 1px,
|
|
205
|
+
// transparent 1px,
|
|
206
|
+
// transparent $row_height
|
|
207
|
+
// );
|
|
208
|
+
// }
|
|
209
|
+
|
|
91
210
|
///
|
|
92
211
|
/// Guide Baseline Mixin
|
|
93
212
|
/// ---------------------------------------------------------------------------
|
|
@@ -104,9 +223,11 @@
|
|
|
104
223
|
/// @include guide_baseline(20px, cyan);
|
|
105
224
|
/// }
|
|
106
225
|
///
|
|
107
|
-
@mixin guide_baseline($size, $color: $
|
|
226
|
+
@mixin guide_baseline($size: baseline(4), $color: $guide_baseline_primary) {
|
|
108
227
|
@include guide;
|
|
228
|
+
background-repeat: repeat;
|
|
109
229
|
background-size: 100% $size;
|
|
230
|
+
|
|
110
231
|
background-image: repeating-linear-gradient(
|
|
111
232
|
to bottom,
|
|
112
233
|
$color 0 1px,
|
|
@@ -114,6 +235,20 @@
|
|
|
114
235
|
);
|
|
115
236
|
}
|
|
116
237
|
|
|
238
|
+
// @mixin guide_baseline {
|
|
239
|
+
// @include guide;
|
|
240
|
+
// // background: repeating-linear-gradient(#e66465, #e66465 20px, #9198e5 20px, #9198e5 25px);
|
|
241
|
+
// // background: repeating-linear-gradient(transparent, transparent 20px, transparent 20px, transparent 25px);
|
|
242
|
+
// // background-repeat: repeat-y;
|
|
243
|
+
// background-repeat: repeat;
|
|
244
|
+
|
|
245
|
+
// background-size: map.get($baseline, 4) map.get($baseline, 4);
|
|
246
|
+
// @include guide;
|
|
247
|
+
// background-image: repeating-linear-gradient(
|
|
248
|
+
// cyan 0 1px,
|
|
249
|
+
// transparent 1px 100%
|
|
250
|
+
// );
|
|
251
|
+
// }
|
|
117
252
|
///
|
|
118
253
|
/// Baseline Grid Mixin
|
|
119
254
|
/// ---------------------------------------------------------------------------
|
|
@@ -133,7 +268,7 @@
|
|
|
133
268
|
/// @include guide_baseline(60px, 20px);
|
|
134
269
|
/// }
|
|
135
270
|
///
|
|
136
|
-
@mixin
|
|
271
|
+
@mixin grid_baseline(
|
|
137
272
|
$column_width,
|
|
138
273
|
$baseline_height,
|
|
139
274
|
$column_color: rgba(200, 0, 0, 0.2),
|
|
@@ -154,33 +289,6 @@
|
|
|
154
289
|
100% $baseline_height;
|
|
155
290
|
}
|
|
156
291
|
|
|
157
|
-
///
|
|
158
|
-
/// Centered Guide Mixin
|
|
159
|
-
/// ---------------------------------------------------------------------------
|
|
160
|
-
///
|
|
161
|
-
/// Creates a centered guide box useful for ensuring elements are
|
|
162
|
-
/// aligned to the center of the viewport.
|
|
163
|
-
///
|
|
164
|
-
/// @name guide_centered
|
|
165
|
-
/// @param {Length} $width - The width of the centered guide box.
|
|
166
|
-
/// @param {Length} $height - The height of the centered guide box.
|
|
167
|
-
/// @param {Color} $color - The color of the guide box border. Defaults to red.
|
|
168
|
-
///
|
|
169
|
-
/// @example scss - Usage
|
|
170
|
-
/// .guide_centered {
|
|
171
|
-
/// @include guide_centered(100px, 100px, red);
|
|
172
|
-
/// }
|
|
173
|
-
///
|
|
174
|
-
@mixin guide_centered($width, $height, $color: red) {
|
|
175
|
-
@include guide;
|
|
176
|
-
width: $width;
|
|
177
|
-
height: $height;
|
|
178
|
-
top: 50%;
|
|
179
|
-
left: 50%;
|
|
180
|
-
transform: translate(-50%, -50%);
|
|
181
|
-
border: 2px solid $color;
|
|
182
|
-
}
|
|
183
|
-
|
|
184
292
|
///
|
|
185
293
|
/// Margin Guide Mixin
|
|
186
294
|
/// ---------------------------------------------------------------------------
|
package/scss/mixins/_helper.scss
CHANGED
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
// ============================================================================
|
|
2
|
-
// Poster
|
|
3
|
-
// ============================================================================
|
|
4
|
-
|
|
5
1
|
////
|
|
6
2
|
///
|
|
7
3
|
/// Helper Mixins Module
|
|
@@ -84,7 +80,7 @@
|
|
|
84
80
|
/// @include set_font-size(16px);
|
|
85
81
|
/// }
|
|
86
82
|
///
|
|
87
|
-
@mixin
|
|
83
|
+
@mixin set_font_size($value) {
|
|
88
84
|
@include q($value, font-size);
|
|
89
85
|
}
|
|
90
86
|
|
|
@@ -116,7 +112,7 @@
|
|
|
116
112
|
/// @include set_letter-spacing(0.1em);
|
|
117
113
|
/// }
|
|
118
114
|
///
|
|
119
|
-
@mixin
|
|
115
|
+
@mixin set_letter_spacing($value) {
|
|
120
116
|
@include q($value, letter-spacing);
|
|
121
117
|
}
|
|
122
118
|
|
package/scss/mixins/_index.scss
CHANGED
package/scss/mixins/_paper.scss
CHANGED
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
// ============================================================================
|
|
2
|
-
// Poster
|
|
3
|
-
// ============================================================================
|
|
4
|
-
|
|
5
1
|
////
|
|
6
2
|
///
|
|
7
3
|
/// Paper Mixins Module
|
|
@@ -46,9 +42,9 @@
|
|
|
46
42
|
///
|
|
47
43
|
@mixin set_paper_size($size) {
|
|
48
44
|
@if map-has-key($paper-sizes, $size) {
|
|
49
|
-
$size-map: map
|
|
50
|
-
width: map
|
|
51
|
-
height: map
|
|
45
|
+
$size-map: map.get($paper-sizes, $size);
|
|
46
|
+
width: map.get($size-map, width);
|
|
47
|
+
height: map.get($size-map, height);
|
|
52
48
|
} @else {
|
|
53
49
|
@warn "Invalid paper size: #{$size}. Available sizes are: #{map-keys($paper-sizes)}.";
|
|
54
50
|
}
|