lumina-sass 2.4.2 → 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.2",
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'
@@ -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')
@@ -150,4 +153,84 @@
150
153
  figure figcaption
151
154
  font-style: italic
152
155
 
156
+ @include true.test-module('Tags and Elements')
157
+ @include true.test('Applies background and text color')
158
+ @include true.assert
159
+ @include true.output
160
+ .custom-bg
161
+ @include misc-styling.background-color(rgb(255, 0, 0), rgb(255, 255, 255))
162
+
163
+ @include true.expect
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
235
+
153
236
  @include true.report