lumina-sass 2.4.1 → 2.5.0

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lumina-sass",
3
- "version": "2.4.1",
3
+ "version": "2.5.0",
4
4
  "description": "Lumina Sass design tokens, mixins and public sub-modules (flexbox, color, mix).",
5
5
  "main": "src/_index.sass",
6
6
  "sass": "src/_index.sass",
@@ -0,0 +1,36 @@
1
+ @use 'sass:color'
2
+ @use 'misc-styling' as *
3
+ @use 'typography' as typo
4
+ @use '../color/palette/groovy-70s' as *
5
+
6
+ @mixin base-btn($bg-color: $groovy-70s-cream, $text-color: $groovy-70s-warm-white, $border-color: null, $size: 1em, $weight: bold)
7
+
8
+ @if $border-color == null
9
+ border: none
10
+ @else
11
+ border: 1px solid $border-color
12
+
13
+ margin: 0.5em
14
+ cursor: pointer
15
+ position: relative
16
+ padding: 0.5em 1.5em
17
+ border-radius: 0.5em
18
+ display: inline-block
19
+ transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), background-color 0.2s
20
+
21
+ @include background-color($bg-color, $text-color)
22
+ @include typo.font($size: $size, $weight: $weight)
23
+
24
+
25
+ &:hover
26
+ transform: scale(1.05)
27
+ background-color: color.adjust($bg-color, $lightness: -5%)
28
+
29
+ &:active
30
+ transform: scale(0.95)
31
+ background-color: color.adjust($bg-color, $lightness: -10%)
32
+
33
+ &:disabled
34
+ opacity: 0.3
35
+ cursor: not-allowed
36
+ pointer-events: none
@@ -0,0 +1,34 @@
1
+ @use 'typography' as typo
2
+ @use '../color/alerts' as *
3
+
4
+ @mixin link-color($color, $color-hover, $color-active, $color-visited)
5
+
6
+ a
7
+ [aria-disabled="true"]
8
+ color: $disabled
9
+ cursor: not-allowed
10
+ pointer-events: none
11
+ text-decoration: none
12
+
13
+ &:active
14
+ color: $color-active
15
+
16
+ &.external-link
17
+ text-decoration: underline
18
+
19
+ @media (hover: hover)
20
+
21
+ &:hover
22
+ color: $color-hover
23
+ border-radius: 0.5em
24
+
25
+ &:visited
26
+ color: $color-visited
27
+
28
+
29
+ h1, h2, h3, h4, h5, h6
30
+ color: $color !important
31
+
32
+ color: $color
33
+ cursor: pointer
34
+ @include typo.text-adjustments()
@@ -1,3 +1,6 @@
1
1
  @forward 'media'
2
2
  @forward 'typography'
3
- @forward 'generators'
3
+ @forward 'generators'
4
+ @forward 'buttons'
5
+ @forward 'elements'
6
+ @forward 'misc-styling'
@@ -54,46 +54,3 @@
54
54
  @content
55
55
  @else
56
56
  @error "Invalid orientation `#{$orientation}` – use portrait or landscape."
57
-
58
- @mixin figure($object-fit: cover, $size: null, $style: italic, $width: 16, $length: 9, $position: null, $percentage: null)
59
- &
60
- video.portrait-media
61
- @if $width != null and $length != null
62
- @include aspect-ratio($width, $length)
63
-
64
- max-inline-size: 20rem !important
65
-
66
- // Landscape video – default ratio
67
- video.landscape-media
68
- @if $width != null and $length != null
69
- @include aspect-ratio($width, $length)
70
- object-position: center 35%
71
-
72
- // Image and picture handling
73
- picture,
74
- img
75
- inline-size: 100%
76
- object-fit: $object-fit
77
-
78
- @if $width != null and $length != null
79
- @include aspect-ratio($width, $length)
80
-
81
- @if $position != null or $percentage != null
82
- object-position: $position $percentage
83
-
84
- picture
85
- img
86
- inline-size: 100%
87
- object-fit: $object-fit
88
-
89
- @if $width != null and $length != null
90
- @include aspect-ratio($width, $length)
91
-
92
- @if $position != null or $percentage != null
93
- object-position: $position $percentage
94
-
95
- figcaption
96
- @include typo.font($size: $size, $style: $style)
97
-
98
- @mixin aspect-ratio($width: 16, $length: 9)
99
- aspect-ratio: #{$width} / #{$length}
@@ -0,0 +1,3 @@
1
+ @mixin background-color($bg-color, $text-color)
2
+ color: rgba($text-color, 1)
3
+ background-color: rgba($bg-color, 1)
@@ -60,4 +60,15 @@
60
60
  @each $category, $map in fonts.$fonts
61
61
  @if map.has-key($map, $font)
62
62
  @return map.get($map, $font)
63
- @return null
63
+ @return null
64
+
65
+ @mixin text-adjustments($alignment: null, $decoration: null)
66
+ @if $alignment != null
67
+ text-align: $alignment
68
+
69
+ @if $decoration != null
70
+ text-decoration: $decoration
71
+
72
+ @if $alignment == null and $decoration == null
73
+ text-decoration: none
74
+ @warn "No parameters provided for text-adjustments mixin. Default value present."
@@ -1,8 +1,11 @@
1
1
  @use 'sass:meta'
2
- @use '../../node_modules/sass-true' as true
3
- @use '../mix/_generators' as generators
4
2
  @use '../mix/_media' as media
5
3
  @use '../mix/_typography' as typo
4
+ @use '../mix/_buttons' as buttons
5
+ @use '../mix/_elements' as elements
6
+ @use '../mix/_generators' as generators
7
+ @use '../mix/_misc-styling' as misc-styling
8
+ @use '../../node_modules/sass-true' as true
6
9
 
7
10
  @include true.test-module('Icon Generator')
8
11
  @include true.test('Generates school icon class')
@@ -139,41 +142,95 @@
139
142
  @include true.assert-equal(typo.font-family-of('mono'), monospace)
140
143
  @include true.assert-equal(typo.font-family-of('serif'), serif)
141
144
 
142
- @include true.test-module('Layout Helpers')
143
- @include true.test('Generates aspect-ratio')
145
+ @include true.test-module('Styling (Native)')
146
+ @include true.test('Applies typography font styling to figcaption')
144
147
  @include true.assert
145
148
  @include true.output
146
- @include media.aspect-ratio(16, 9)
149
+ figure figcaption
150
+ @include typo.font($style: italic)
147
151
 
148
152
  @include true.expect
149
- aspect-ratio: 16 / 9
153
+ figure figcaption
154
+ font-style: italic
150
155
 
151
- @include true.test('Generates figure structure')
156
+ @include true.test-module('Tags and Elements')
157
+ @include true.test('Applies background and text color')
152
158
  @include true.assert
153
159
  @include true.output
154
- figure
155
- @include media.figure()
160
+ .custom-bg
161
+ @include misc-styling.background-color(rgb(255, 0, 0), rgb(255, 255, 255))
156
162
 
157
163
  @include true.expect
158
- figure video.portrait-media
159
- aspect-ratio: 16 / 9
160
- max-inline-size: 20rem !important
161
-
162
- figure video.landscape-media
163
- aspect-ratio: 16 / 9
164
- object-position: center 35%
165
-
166
- figure picture, figure img
167
- inline-size: 100%
168
- object-fit: cover
169
- aspect-ratio: 16 / 9
170
-
171
- figure picture img
172
- inline-size: 100%
173
- object-fit: cover
174
- aspect-ratio: 16 / 9
175
-
176
- figure picture figcaption
177
- font-style: italic
164
+ .custom-bg
165
+ color: rgba(255, 255, 255, 1)
166
+ background-color: rgba(255, 0, 0, 1)
167
+
168
+ @include true.test('Applies base button styling')
169
+ @include true.assert
170
+ @include true.output
171
+ button
172
+ @include buttons.base-btn()
173
+
174
+ @include true.expect
175
+ button
176
+ border: none
177
+ margin: 0.5em
178
+ cursor: pointer
179
+ position: relative
180
+ padding: 0.5em 1.5em
181
+ border-radius: 0.5em
182
+ display: inline-block
183
+ transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), background-color 0.2s
184
+ color: rgb(255, 248, 241)
185
+ background-color: rgb(252, 245, 235)
186
+ font-size: 1em
187
+ font-weight: bold
188
+ font-style: normal
189
+
190
+ &:hover
191
+ transform: scale(1.05)
192
+ background-color: rgb(248.6739130435, 233.9130434783, 212.8260869565)
193
+
194
+ &:active
195
+ transform: scale(0.95)
196
+ background-color: rgb(245.347826087, 222.8260869565, 190.652173913)
197
+
198
+ &:disabled
199
+ opacity: 0.3
200
+ cursor: not-allowed
201
+
202
+ @include true.test('Applies link colors and properties')
203
+ @include true.assert
204
+ @include true.output
205
+ @include elements.link-color(rgb(0, 0, 255), rgb(0, 0, 200), rgb(0, 0, 150), rgb(128, 0, 128))
206
+
207
+ @include true.expect
208
+ a
209
+ color: rgb(0, 0, 255)
210
+ cursor: pointer
211
+ text-decoration: none
212
+
213
+ [aria-disabled="true"]
214
+ color: rgb(160, 160, 160)
215
+ cursor: not-allowed
216
+ pointer-events: none
217
+ text-decoration: none
218
+
219
+ &:active
220
+ color: rgb(0, 0, 150)
221
+
222
+ &.external-link
223
+ text-decoration: underline
224
+
225
+ @media (hover: hover)
226
+ &:hover
227
+ color: rgb(0, 0, 200)
228
+ border-radius: 0.5em
229
+
230
+ &:visited
231
+ color: rgb(128, 0, 128)
232
+
233
+ h1, h2, h3, h4, h5, h6
234
+ color: rgb(0, 0, 255) !important
178
235
 
179
236
  @include true.report