lumina-sass 2.3.0 → 2.3.2
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/package.json +1 -1
- package/src/map/_inputs.sass +2 -2
- package/src/mix/_media.sass +15 -9
- package/src/mix/_typography.sass +12 -9
- package/src/test/mixins.spec.sass +13 -19
package/package.json
CHANGED
package/src/map/_inputs.sass
CHANGED
|
@@ -14,14 +14,14 @@ $inputs: (
|
|
|
14
14
|
)
|
|
15
15
|
|
|
16
16
|
$default-input-props: (
|
|
17
|
-
border: rgb(204, 204, 204) solid
|
|
17
|
+
border: rgb(204, 204, 204) solid 0.0625rem,
|
|
18
18
|
padding: 0.5rem 1rem,
|
|
19
19
|
"border-radius": 0.5rem,
|
|
20
20
|
"background-color": rgb(255, 255, 255),
|
|
21
21
|
"font-size": 1rem,
|
|
22
22
|
"line-height": 1.5,
|
|
23
23
|
"box-sizing": border-box,
|
|
24
|
-
outline:
|
|
24
|
+
outline: 0.0625rem solid rgb(0, 120, 215),
|
|
25
25
|
"focus-outline": rgb(0, 120, 215),
|
|
26
26
|
cursor: text
|
|
27
27
|
)
|
package/src/mix/_media.sass
CHANGED
|
@@ -56,36 +56,42 @@
|
|
|
56
56
|
@error "Invalid orientation `#{$orientation}` – use portrait or landscape."
|
|
57
57
|
|
|
58
58
|
@mixin figure($object-fit: cover, $size: null, $style: italic, $width: 16, $length: 9, $position: null, $percentage: null)
|
|
59
|
-
|
|
60
|
-
// Portrait video – forced 9:16 ratio
|
|
59
|
+
&
|
|
61
60
|
video.portrait-media
|
|
62
|
-
|
|
63
|
-
|
|
61
|
+
@if $width != null and $length != null
|
|
62
|
+
@include aspect-ratio($width, $length)
|
|
63
|
+
|
|
64
|
+
max-inline-size: 20rem !important
|
|
64
65
|
|
|
65
66
|
// Landscape video – default ratio
|
|
66
67
|
video.landscape-media
|
|
68
|
+
@if $width != null and $length != null
|
|
69
|
+
@include aspect-ratio($width, $length)
|
|
67
70
|
object-position: center 35%
|
|
68
|
-
@include aspect-ratio()
|
|
69
71
|
|
|
70
72
|
// Image and picture handling
|
|
71
73
|
picture,
|
|
72
74
|
img
|
|
73
75
|
inline-size: 100%
|
|
74
76
|
object-fit: $object-fit
|
|
75
|
-
|
|
77
|
+
|
|
78
|
+
@if $width != null and $length != null
|
|
79
|
+
@include aspect-ratio($width, $length)
|
|
80
|
+
|
|
76
81
|
@if $position != null or $percentage != null
|
|
77
82
|
object-position: $position $percentage
|
|
78
83
|
|
|
79
|
-
// Nested <picture><img> – duplicate settings for readability
|
|
80
84
|
picture
|
|
81
85
|
img
|
|
82
86
|
inline-size: 100%
|
|
83
87
|
object-fit: $object-fit
|
|
84
|
-
|
|
88
|
+
|
|
89
|
+
@if $width != null and $length != null
|
|
90
|
+
@include aspect-ratio($width, $length)
|
|
91
|
+
|
|
85
92
|
@if $position != null or $percentage != null
|
|
86
93
|
object-position: $position $percentage
|
|
87
94
|
|
|
88
|
-
// Figcaption styling if size provided
|
|
89
95
|
figcaption
|
|
90
96
|
@include typo.font($size: $size, $style: $style)
|
|
91
97
|
|
package/src/mix/_typography.sass
CHANGED
|
@@ -13,21 +13,21 @@
|
|
|
13
13
|
|
|
14
14
|
@mixin font-style($font, $family: null, $line-height: null, $variant: null)
|
|
15
15
|
$detected-family: font-family-of($font)
|
|
16
|
+
|
|
16
17
|
@if $detected-family != null
|
|
17
18
|
$family: $detected-family
|
|
19
|
+
|
|
18
20
|
@if $line-height != null
|
|
19
21
|
line-height: $line-height
|
|
22
|
+
|
|
20
23
|
@if $variant != null
|
|
21
24
|
font-variant: $variant
|
|
22
|
-
|
|
25
|
+
|
|
23
26
|
font-family: $font, $family
|
|
24
27
|
|
|
25
|
-
@mixin font( $font:
|
|
28
|
+
@mixin font( $font:null, $size: 1rem, $family: null, $style: null, $weight: null, $line-height: null, $variant: null)
|
|
26
29
|
@if $font != null
|
|
27
|
-
@include font-style($font, $family)
|
|
28
|
-
|
|
29
|
-
@else if $family != null
|
|
30
|
-
font-family: $family
|
|
30
|
+
@include font-style($font, $family, $line-height, $variant)
|
|
31
31
|
|
|
32
32
|
@if $size != null
|
|
33
33
|
font-size: $size
|
|
@@ -37,14 +37,17 @@
|
|
|
37
37
|
|
|
38
38
|
@if $style != null
|
|
39
39
|
font-style: $style
|
|
40
|
+
|
|
41
|
+
@if $variant != null
|
|
42
|
+
font-variant: $variant
|
|
40
43
|
|
|
41
|
-
@mixin
|
|
44
|
+
@mixin sans-serif($font, $size: 1rem, $weight: null, $style: null)
|
|
42
45
|
@include font($font, $size, sans-serif, $style, $weight)
|
|
43
46
|
|
|
44
|
-
@mixin
|
|
47
|
+
@mixin serif($font, $size: 1rem, $weight: null, $style: null)
|
|
45
48
|
@include font($font, $size, serif, $style, $weight)
|
|
46
49
|
|
|
47
|
-
@mixin
|
|
50
|
+
@mixin monospace($font, $size: 1rem, $weight: null, $style: null)
|
|
48
51
|
@include font($font, $size, monospace, $style, $weight)
|
|
49
52
|
|
|
50
53
|
// Helper: return the generic family for a given font name using the fonts map.
|
|
@@ -36,14 +36,14 @@
|
|
|
36
36
|
|
|
37
37
|
@include true.expect
|
|
38
38
|
input[type="text"]
|
|
39
|
-
border: rgb(204, 204, 204) solid
|
|
39
|
+
border: rgb(204, 204, 204) solid 0.0625rem
|
|
40
40
|
padding: 0.5rem 1rem
|
|
41
41
|
border-radius: 0.5rem
|
|
42
42
|
background-color: rgb(255, 255, 255)
|
|
43
43
|
font-size: 1rem
|
|
44
44
|
line-height: 1.5
|
|
45
45
|
box-sizing: border-box
|
|
46
|
-
outline:
|
|
46
|
+
outline: 0.0625rem solid rgb(0, 120, 215)
|
|
47
47
|
focus-outline: rgb(0, 120, 215)
|
|
48
48
|
cursor: text
|
|
49
49
|
|
|
@@ -103,40 +103,34 @@
|
|
|
103
103
|
@include true.expect
|
|
104
104
|
font-size: 2rem
|
|
105
105
|
font-weight: bold
|
|
106
|
-
font-style: normal
|
|
107
106
|
|
|
108
|
-
@include true.test('Generates
|
|
107
|
+
@include true.test('Generates sans-serif styles')
|
|
109
108
|
@include true.assert
|
|
110
109
|
@include true.output
|
|
111
|
-
@include typo.
|
|
110
|
+
@include typo.sans-serif('Roboto', $size: 1.5rem)
|
|
112
111
|
|
|
113
112
|
@include true.expect
|
|
114
113
|
font-family: "Roboto", sans-serif
|
|
115
114
|
font-size: 1.5rem
|
|
116
|
-
font-weight: normal
|
|
117
|
-
font-style: normal
|
|
118
115
|
|
|
119
|
-
@include true.test('Generates
|
|
116
|
+
@include true.test('Generates serif styles')
|
|
120
117
|
@include true.assert
|
|
121
118
|
@include true.output
|
|
122
|
-
@include typo.
|
|
119
|
+
@include typo.serif('Georgia', $size: 1.2rem)
|
|
123
120
|
|
|
124
121
|
@include true.expect
|
|
125
122
|
font-family: "Georgia", serif
|
|
126
123
|
font-size: 1.2rem
|
|
127
|
-
font-weight: normal
|
|
128
|
-
font-style: normal
|
|
129
124
|
|
|
130
|
-
@include true.test('Generates
|
|
125
|
+
@include true.test('Generates monospace styles')
|
|
131
126
|
@include true.assert
|
|
132
127
|
@include true.output
|
|
133
|
-
@include typo.
|
|
128
|
+
@include typo.monospace('Fira Code', $weight: 500)
|
|
134
129
|
|
|
135
130
|
@include true.expect
|
|
136
131
|
font-family: "Fira Code", monospace
|
|
137
132
|
font-size: 1rem
|
|
138
133
|
font-weight: 500
|
|
139
|
-
font-style: normal
|
|
140
134
|
|
|
141
135
|
@include true.test('Returns correct font-family for known font')
|
|
142
136
|
@include true.assert-equal(typo.font-family-of('Open Sans'), sans-serif)
|
|
@@ -157,16 +151,17 @@
|
|
|
157
151
|
@include true.test('Generates figure structure')
|
|
158
152
|
@include true.assert
|
|
159
153
|
@include true.output
|
|
160
|
-
|
|
154
|
+
figure
|
|
155
|
+
@include media.figure()
|
|
161
156
|
|
|
162
157
|
@include true.expect
|
|
163
158
|
figure video.portrait-media
|
|
164
|
-
|
|
165
|
-
|
|
159
|
+
aspect-ratio: 16 / 9
|
|
160
|
+
max-inline-size: 20rem !important
|
|
166
161
|
|
|
167
162
|
figure video.landscape-media
|
|
168
|
-
object-position: center 35%
|
|
169
163
|
aspect-ratio: 16 / 9
|
|
164
|
+
object-position: center 35%
|
|
170
165
|
|
|
171
166
|
figure picture, figure img
|
|
172
167
|
inline-size: 100%
|
|
@@ -179,7 +174,6 @@
|
|
|
179
174
|
aspect-ratio: 16 / 9
|
|
180
175
|
|
|
181
176
|
figure picture figcaption
|
|
182
|
-
font-weight: normal
|
|
183
177
|
font-style: italic
|
|
184
178
|
|
|
185
179
|
@include true.report
|