lumina-sass 2.6.2 → 2.6.3
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 +2 -2
- package/src/map/_fonts.sass +2 -1
- package/src/mix/_generators.sass +3 -3
- package/src/mix/_media.sass +3 -3
- package/src/mix/_typography.sass +4 -10
- package/src/mix/test/_buttons.spec.sass +40 -0
- package/src/mix/test/_elements.spec.sass +38 -0
- package/src/mix/test/_generators.spec.sass +63 -0
- package/src/mix/test/_media.spec.sass +35 -0
- package/src/mix/test/_misc-styling.spec.sass +16 -0
- package/src/mix/test/_typography.spec.sass +123 -0
- package/src/test/index.spec.sass +11 -0
- package/src/test/mixins.spec.sass +0 -299
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lumina-sass",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.3",
|
|
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",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"dev": "npm run build && npm run serve",
|
|
33
33
|
"build:demo": "sass demo/style.sass demo/style.css",
|
|
34
34
|
"build": "sass src/_index.sass test/index.css && sass src/color/_index.sass test/color.css && sass src/mix/_index.sass test/mix.css && sass src/flexbox/_index.sass test/flexbox.css && sass src/flexbox/_index.sass test/flexbox.css",
|
|
35
|
-
"test:sass": "sass src/test/
|
|
35
|
+
"test:sass": "sass src/test/index.spec.sass src/test/index.spec.css",
|
|
36
36
|
"test": "npm run test:sass"
|
|
37
37
|
},
|
|
38
38
|
"files": [
|
package/src/map/_fonts.sass
CHANGED
|
@@ -7,7 +7,8 @@ $sans-serif: (
|
|
|
7
7
|
'Inter': sans-serif, 'Tahoma': sans-serif, 'Verdana': sans-serif,
|
|
8
8
|
'Gill Sans': sans-serif, 'Futura': sans-serif, 'Ubuntu': sans-serif,
|
|
9
9
|
'Noto Sans': sans-serif, 'Noto Sans KR': sans-serif, 'Noto Sans JP': sans-serif,
|
|
10
|
-
'Noto Sans SC': sans-serif, 'Noto Sans Arabic': sans-serif, 'Noto Sans Hebrew': sans-serif
|
|
10
|
+
'Noto Sans SC': sans-serif, 'Noto Sans Arabic': sans-serif, 'Noto Sans Hebrew': sans-serif,
|
|
11
|
+
'Bootstrap': sans-serif, 'bootstrap-icons': sans-serif
|
|
11
12
|
)
|
|
12
13
|
|
|
13
14
|
$serif: (
|
package/src/mix/_generators.sass
CHANGED
|
@@ -94,15 +94,15 @@
|
|
|
94
94
|
|
|
95
95
|
// Range track styling
|
|
96
96
|
&::-webkit-slider-runnable-track
|
|
97
|
-
|
|
97
|
+
block-size: 0.4rem
|
|
98
98
|
background: #ddd
|
|
99
99
|
border-radius: 0.2rem
|
|
100
100
|
|
|
101
101
|
// Range thumb styling
|
|
102
102
|
&::-webkit-slider-thumb
|
|
103
103
|
-webkit-appearance: none
|
|
104
|
-
|
|
105
|
-
|
|
104
|
+
inline-size: 1rem
|
|
105
|
+
block-size: 1rem
|
|
106
106
|
background: #0078d7
|
|
107
107
|
border-radius: 50%
|
|
108
108
|
margin-top: -0.3rem
|
package/src/mix/_media.sass
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
@content
|
|
12
12
|
@else if map.has-key(bp.$breakpoints, $breakpoint)
|
|
13
13
|
$breakpoint-value: map.get(bp.$breakpoints, $breakpoint)
|
|
14
|
-
@media (max-
|
|
14
|
+
@media (max-inline-size: $breakpoint-value)
|
|
15
15
|
@content
|
|
16
16
|
@else
|
|
17
17
|
@media #{$breakpoint}
|
|
@@ -45,12 +45,12 @@
|
|
|
45
45
|
@if $orientation == portrait
|
|
46
46
|
$max-width: $width + 0.125rem
|
|
47
47
|
$max-height: $height + 0.125rem
|
|
48
|
-
@media only screen and (min-
|
|
48
|
+
@media only screen and (min-inline-size: $width) and (max-inline-size: $max-width) and (min-block-size: $height) and (max-block-size: $max-height) and (orientation: portrait)
|
|
49
49
|
@content
|
|
50
50
|
@else if $orientation == landscape
|
|
51
51
|
$max-height: $height + 0.125rem
|
|
52
52
|
$max-width: $width + 0.125rem
|
|
53
|
-
@media only screen and (min-
|
|
53
|
+
@media only screen and (min-inline-size: $height) and (max-inline-size: $max-height) and (min-block-size: $width) and (max-block-size: $max-width) and (orientation: landscape)
|
|
54
54
|
@content
|
|
55
55
|
@else
|
|
56
56
|
@error "Invalid orientation `#{$orientation}` – use portrait or landscape."
|
package/src/mix/_typography.sass
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
overflow-wrap: anywhere
|
|
14
14
|
min-inline-size: $inline
|
|
15
15
|
|
|
16
|
-
@mixin font
|
|
16
|
+
@mixin font( $font:null, $size: 1rem, $family: null, $style: null, $weight: null, $line-height: null, $variant: null)
|
|
17
17
|
$detected-family: font-family-of($font)
|
|
18
18
|
|
|
19
19
|
@if is-known-font($font)
|
|
@@ -29,20 +29,11 @@
|
|
|
29
29
|
@if $last == $family
|
|
30
30
|
$family: null
|
|
31
31
|
|
|
32
|
-
@if $line-height != null
|
|
33
|
-
line-height: $line-height
|
|
34
|
-
|
|
35
|
-
@if $variant != null
|
|
36
|
-
font-variant: $variant
|
|
37
|
-
|
|
38
32
|
@if $font != null
|
|
39
33
|
font-family: $font, $family
|
|
40
34
|
@else
|
|
41
35
|
font-family: $family
|
|
42
36
|
|
|
43
|
-
@mixin font( $font:null, $size: 1rem, $family: null, $style: null, $weight: null, $line-height: null, $variant: null)
|
|
44
|
-
@include font-style($font, $family, $line-height, $variant)
|
|
45
|
-
|
|
46
37
|
@if $size != null
|
|
47
38
|
font-size: $size
|
|
48
39
|
|
|
@@ -52,6 +43,9 @@
|
|
|
52
43
|
@if $style != null
|
|
53
44
|
font-style: $style
|
|
54
45
|
|
|
46
|
+
@if $line-height != null
|
|
47
|
+
line-height: $line-height
|
|
48
|
+
|
|
55
49
|
@if $variant != null
|
|
56
50
|
font-variant: $variant
|
|
57
51
|
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
@use 'sass:meta'
|
|
2
|
+
@use '../_buttons' as buttons
|
|
3
|
+
@use '../../../node_modules/sass-true' as true
|
|
4
|
+
|
|
5
|
+
@include true.test-module('Buttons')
|
|
6
|
+
@include true.test('Applies base button styling')
|
|
7
|
+
@include true.assert
|
|
8
|
+
@include true.output
|
|
9
|
+
button
|
|
10
|
+
@include buttons.base-btn()
|
|
11
|
+
|
|
12
|
+
@include true.expect
|
|
13
|
+
button
|
|
14
|
+
|
|
15
|
+
border: none
|
|
16
|
+
margin: 0.5em
|
|
17
|
+
font-size: 1em
|
|
18
|
+
cursor: pointer
|
|
19
|
+
font-weight: bold
|
|
20
|
+
font-style: normal
|
|
21
|
+
position: relative
|
|
22
|
+
padding: 0.5em 1.5em
|
|
23
|
+
border-radius: 0.5em
|
|
24
|
+
display: inline-block
|
|
25
|
+
color: rgb(255, 248, 241)
|
|
26
|
+
background-color: rgb(252, 245, 235)
|
|
27
|
+
transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), background-color 0.2s
|
|
28
|
+
|
|
29
|
+
&:hover
|
|
30
|
+
transform: scale(1.05)
|
|
31
|
+
background-color: rgb(248.6739130435, 233.9130434783, 212.8260869565)
|
|
32
|
+
|
|
33
|
+
&:active
|
|
34
|
+
transform: scale(0.95)
|
|
35
|
+
background-color: rgb(245.347826087, 222.8260869565, 190.652173913)
|
|
36
|
+
|
|
37
|
+
&:disabled
|
|
38
|
+
opacity: 0.3
|
|
39
|
+
cursor: not-allowed
|
|
40
|
+
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
@use 'sass:meta'
|
|
2
|
+
@use '../_elements' as elements
|
|
3
|
+
@use '../../../node_modules/sass-true' as true
|
|
4
|
+
|
|
5
|
+
@include true.test-module('Elements')
|
|
6
|
+
@include true.test('Applies link colors and properties')
|
|
7
|
+
@include true.assert
|
|
8
|
+
@include true.output
|
|
9
|
+
@include elements.link-color(rgb(0, 0, 255), rgb(0, 0, 200), rgb(0, 0, 150), rgb(128, 0, 128))
|
|
10
|
+
|
|
11
|
+
@include true.expect
|
|
12
|
+
a
|
|
13
|
+
color: rgb(0, 0, 255)
|
|
14
|
+
cursor: pointer
|
|
15
|
+
text-decoration: none
|
|
16
|
+
|
|
17
|
+
[aria-disabled="true"]
|
|
18
|
+
color: rgb(160, 160, 160)
|
|
19
|
+
cursor: not-allowed
|
|
20
|
+
pointer-events: none
|
|
21
|
+
text-decoration: none
|
|
22
|
+
|
|
23
|
+
&:active
|
|
24
|
+
color: rgb(0, 0, 150)
|
|
25
|
+
|
|
26
|
+
&.external-link
|
|
27
|
+
text-decoration: underline
|
|
28
|
+
|
|
29
|
+
@media (hover: hover)
|
|
30
|
+
&:hover
|
|
31
|
+
color: rgb(0, 0, 200)
|
|
32
|
+
border-radius: 0.5em
|
|
33
|
+
|
|
34
|
+
&:visited
|
|
35
|
+
color: rgb(128, 0, 128)
|
|
36
|
+
|
|
37
|
+
h1, h2, h3, h4, h5, h6
|
|
38
|
+
color: rgb(0, 0, 255) !important
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
@use 'sass:meta'
|
|
2
|
+
@use '../_generators' as generators
|
|
3
|
+
@use '../../../node_modules/sass-true' as true
|
|
4
|
+
|
|
5
|
+
@include true.test-module('Icon Generator')
|
|
6
|
+
@include true.test('Generates school icon class')
|
|
7
|
+
@include true.assert
|
|
8
|
+
@include true.output
|
|
9
|
+
@include generators.icon-generator('school')
|
|
10
|
+
|
|
11
|
+
@include true.expect
|
|
12
|
+
.school
|
|
13
|
+
&::before
|
|
14
|
+
color: rgb(64, 64, 64) !important
|
|
15
|
+
font-family: 'bootstrap-icons'
|
|
16
|
+
content: "\F671"
|
|
17
|
+
|
|
18
|
+
@include true.test-module('Flexbox Generator')
|
|
19
|
+
@include true.test('Generates flex-row properties')
|
|
20
|
+
@include true.assert
|
|
21
|
+
@include true.output
|
|
22
|
+
@include generators.flexbox-generator('flex-row')
|
|
23
|
+
|
|
24
|
+
@include true.expect
|
|
25
|
+
display: flex
|
|
26
|
+
flex-wrap: nowrap
|
|
27
|
+
flex-direction: row
|
|
28
|
+
|
|
29
|
+
@include true.test-module('Input Generator')
|
|
30
|
+
@include true.test('Generates text input type')
|
|
31
|
+
@include true.assert
|
|
32
|
+
@include true.output
|
|
33
|
+
@include generators.input-generator('text')
|
|
34
|
+
|
|
35
|
+
@include true.expect
|
|
36
|
+
input[type="text"]
|
|
37
|
+
cursor: text
|
|
38
|
+
font-size: 1rem
|
|
39
|
+
line-height: 1.5
|
|
40
|
+
padding: 0.5rem 1rem
|
|
41
|
+
border-radius: 0.5rem
|
|
42
|
+
box-sizing: border-box
|
|
43
|
+
focus-outline: rgb(0, 120, 215)
|
|
44
|
+
background-color: rgb(255, 255, 255)
|
|
45
|
+
border: rgb(204, 204, 204) solid 0.0625rem
|
|
46
|
+
outline: 0.0625rem solid rgb(0, 120, 215)
|
|
47
|
+
|
|
48
|
+
input[type="text"]::focus
|
|
49
|
+
outline: rgb(0, 120, 215)
|
|
50
|
+
|
|
51
|
+
&::-webkit-slider-runnable-track
|
|
52
|
+
block-size: 0.4rem
|
|
53
|
+
background: #ddd
|
|
54
|
+
border-radius: 0.2rem
|
|
55
|
+
|
|
56
|
+
&::-webkit-slider-thumb
|
|
57
|
+
-webkit-appearance: none
|
|
58
|
+
inline-size: 1rem
|
|
59
|
+
block-size: 1rem
|
|
60
|
+
background: #0078d7
|
|
61
|
+
border-radius: 50%
|
|
62
|
+
margin-top: -0.3rem
|
|
63
|
+
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
@use 'sass:meta'
|
|
2
|
+
@use '../_media' as media
|
|
3
|
+
@use '../../../node_modules/sass-true' as true
|
|
4
|
+
|
|
5
|
+
@include true.test-module('Media Queries')
|
|
6
|
+
@include true.test('Generates max-width media query for breakpoint md')
|
|
7
|
+
@include true.assert
|
|
8
|
+
@include true.output
|
|
9
|
+
@include media.media-queries('md')
|
|
10
|
+
color: blue
|
|
11
|
+
|
|
12
|
+
@include true.expect
|
|
13
|
+
@media (max-inline-size: 64rem)
|
|
14
|
+
color: blue
|
|
15
|
+
|
|
16
|
+
@include true.test('Generates prefers-color-scheme')
|
|
17
|
+
@include true.assert
|
|
18
|
+
@include true.output
|
|
19
|
+
@include media.prefers-color-scheme(dark)
|
|
20
|
+
background: black
|
|
21
|
+
|
|
22
|
+
@include true.expect
|
|
23
|
+
@media (prefers-color-scheme: dark)
|
|
24
|
+
background: black
|
|
25
|
+
|
|
26
|
+
@include true.test('Generates device-media for iphone')
|
|
27
|
+
@include true.assert
|
|
28
|
+
@include true.output
|
|
29
|
+
@include media.device-media('iphone')
|
|
30
|
+
color: white
|
|
31
|
+
|
|
32
|
+
@include true.expect
|
|
33
|
+
@media only screen and (min-inline-size: 20rem) and (max-inline-size: 20.125rem) and (min-block-size: 30rem) and (max-block-size: 30.125rem) and (orientation: portrait)
|
|
34
|
+
color: white
|
|
35
|
+
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
@use 'sass:meta'
|
|
2
|
+
@use '../_misc-styling' as misc-styling
|
|
3
|
+
@use '../../../node_modules/sass-true' as true
|
|
4
|
+
|
|
5
|
+
@include true.test-module('Misc Styling')
|
|
6
|
+
@include true.test('Applies background and text color')
|
|
7
|
+
@include true.assert
|
|
8
|
+
@include true.output
|
|
9
|
+
.custom-bg
|
|
10
|
+
@include misc-styling.background-color(rgb(255, 0, 0), rgb(255, 255, 255))
|
|
11
|
+
|
|
12
|
+
@include true.expect
|
|
13
|
+
.custom-bg
|
|
14
|
+
color: rgba(255, 255, 255, 1)
|
|
15
|
+
background-color: rgba(255, 0, 0, 1)
|
|
16
|
+
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
@use 'sass:meta'
|
|
2
|
+
@use '../_typography' as typo
|
|
3
|
+
@use '../../../node_modules/sass-true' as true
|
|
4
|
+
|
|
5
|
+
@include true.test-module('Typography')
|
|
6
|
+
@include true.test('Generates font styles')
|
|
7
|
+
@include true.assert
|
|
8
|
+
@include true.output
|
|
9
|
+
@include typo.font($size: 2rem, $weight: bold)
|
|
10
|
+
|
|
11
|
+
@include true.expect
|
|
12
|
+
font-size: 2rem
|
|
13
|
+
font-weight: bold
|
|
14
|
+
|
|
15
|
+
@include true.test('Generates sans-serif styles')
|
|
16
|
+
@include true.assert
|
|
17
|
+
@include true.output
|
|
18
|
+
@include typo.sans-serif('Roboto', $size: 1.5rem)
|
|
19
|
+
|
|
20
|
+
@include true.expect
|
|
21
|
+
font-family: "Roboto", sans-serif
|
|
22
|
+
font-size: 1.5rem
|
|
23
|
+
|
|
24
|
+
@include true.test('Generates serif styles')
|
|
25
|
+
@include true.assert
|
|
26
|
+
@include true.output
|
|
27
|
+
@include typo.serif('Georgia', $size: 1.2rem)
|
|
28
|
+
|
|
29
|
+
@include true.expect
|
|
30
|
+
font-family: "Georgia", serif
|
|
31
|
+
font-size: 1.2rem
|
|
32
|
+
|
|
33
|
+
@include true.test('Generates monospace styles')
|
|
34
|
+
@include true.assert
|
|
35
|
+
@include true.output
|
|
36
|
+
@include typo.monospace('Fira Code', $weight: 500)
|
|
37
|
+
|
|
38
|
+
@include true.expect
|
|
39
|
+
font-family: "Fira Code", monospace
|
|
40
|
+
font-size: 1rem
|
|
41
|
+
font-weight: 500
|
|
42
|
+
|
|
43
|
+
@include true.test('Returns correct font-family for known font')
|
|
44
|
+
@include true.assert-equal(typo.font-family-of('Open Sans'), sans-serif)
|
|
45
|
+
|
|
46
|
+
@include true.test('Detects generic category names')
|
|
47
|
+
@include true.assert-equal(typo.font-family-of('mono'), monospace)
|
|
48
|
+
@include true.assert-equal(typo.font-family-of('serif'), serif)
|
|
49
|
+
|
|
50
|
+
@include true.test('Provides fallbacks for unknown fonts in font-family-of')
|
|
51
|
+
@include true.assert-equal(typo.font-family-of('MyCustomFont'), ('Nunito', Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif))
|
|
52
|
+
|
|
53
|
+
@include true.test('Generates fallback for unknown font')
|
|
54
|
+
@include true.assert
|
|
55
|
+
@include true.output
|
|
56
|
+
@include typo.font('MyCustomFont')
|
|
57
|
+
|
|
58
|
+
@include true.expect
|
|
59
|
+
font-family: "MyCustomFont", "Nunito", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif
|
|
60
|
+
|
|
61
|
+
@include true.test('Generates fallback for unknown font')
|
|
62
|
+
@include true.assert
|
|
63
|
+
@include true.output
|
|
64
|
+
@include typo.font()
|
|
65
|
+
|
|
66
|
+
@include true.expect
|
|
67
|
+
font-family: "Nunito", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif
|
|
68
|
+
|
|
69
|
+
@include true.test('Does not overwrite explicit fallback override for unknown font')
|
|
70
|
+
@include true.assert
|
|
71
|
+
@include true.output
|
|
72
|
+
@include typo.font('MyCustomFont', $family: serif)
|
|
73
|
+
|
|
74
|
+
@include true.expect
|
|
75
|
+
font-family: "MyCustomFont", serif
|
|
76
|
+
|
|
77
|
+
@include true.test('Generates default fallback stack when no font is provided')
|
|
78
|
+
@include true.assert
|
|
79
|
+
@include true.output
|
|
80
|
+
@include typo.font()
|
|
81
|
+
|
|
82
|
+
@include true.expect
|
|
83
|
+
font-family: "Nunito", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif
|
|
84
|
+
font-size: 1rem
|
|
85
|
+
|
|
86
|
+
@include true.test('Generates default system sans-serif stack when no font is provided')
|
|
87
|
+
@include true.assert
|
|
88
|
+
@include true.output
|
|
89
|
+
@include typo.sans-serif()
|
|
90
|
+
|
|
91
|
+
@include true.expect
|
|
92
|
+
font-family: "Roboto", "Helvetica", "Arial", "Work Sans", "Nunito", "Open Sans", "Lato", "Montserrat", "Source Sans Pro", "Inter", "Tahoma", "Verdana", "Gill Sans", "Futura", "Ubuntu", "Noto Sans", "Noto Sans KR", "Noto Sans JP", "Noto Sans SC", "Noto Sans Arabic", "Noto Sans Hebrew", "Bootstrap", "bootstrap-icons", sans-serif
|
|
93
|
+
font-size: 1rem
|
|
94
|
+
|
|
95
|
+
@include true.test('Generates default system serif stack when no font is provided')
|
|
96
|
+
@include true.assert
|
|
97
|
+
@include true.output
|
|
98
|
+
@include typo.serif()
|
|
99
|
+
|
|
100
|
+
@include true.expect
|
|
101
|
+
font-family: "Georgia", "Times New Roman", "Palatino", "Libre Baskerville", "Merriweather", "PT Serif", "Noto Serif", "Noto Serif KR", "Noto Serif JP", "Noto Serif SC", serif
|
|
102
|
+
font-size: 1rem
|
|
103
|
+
|
|
104
|
+
@include true.test('Generates default system monospace stack when no font is provided')
|
|
105
|
+
@include true.assert
|
|
106
|
+
@include true.output
|
|
107
|
+
@include typo.monospace()
|
|
108
|
+
|
|
109
|
+
@include true.expect
|
|
110
|
+
font-family: "Courier New", "Consolas", "Ubuntu Mono", "Source Code Pro", "Fira Code", "Inconsolata", "Menlo", "Monaco", "Noto Mono", monospace
|
|
111
|
+
font-size: 1rem
|
|
112
|
+
|
|
113
|
+
@include true.test-module('Styling (Native)')
|
|
114
|
+
@include true.test('Applies typography font styling to figcaption')
|
|
115
|
+
@include true.assert
|
|
116
|
+
@include true.output
|
|
117
|
+
figure figcaption
|
|
118
|
+
@include typo.font($style: italic)
|
|
119
|
+
|
|
120
|
+
@include true.expect
|
|
121
|
+
figure figcaption
|
|
122
|
+
font-style: italic
|
|
123
|
+
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
@use '../../node_modules/sass-true' as true
|
|
2
|
+
|
|
3
|
+
// Import all colocated Sass tests here
|
|
4
|
+
@use '../mix/test/media.spec'
|
|
5
|
+
@use '../mix/test/buttons.spec'
|
|
6
|
+
@use '../mix/test/elements.spec'
|
|
7
|
+
@use '../mix/test/generators.spec'
|
|
8
|
+
@use '../mix/test/typography.spec'
|
|
9
|
+
@use '../mix/test/misc-styling.spec'
|
|
10
|
+
|
|
11
|
+
@include true.report
|
|
@@ -1,299 +0,0 @@
|
|
|
1
|
-
@use 'sass:meta'
|
|
2
|
-
@use '../mix/_media' as media
|
|
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
|
|
9
|
-
|
|
10
|
-
@include true.test-module('Icon Generator')
|
|
11
|
-
@include true.test('Generates school icon class')
|
|
12
|
-
@include true.assert
|
|
13
|
-
@include true.output
|
|
14
|
-
@include generators.icon-generator('school')
|
|
15
|
-
|
|
16
|
-
@include true.expect
|
|
17
|
-
.school
|
|
18
|
-
&::before
|
|
19
|
-
color: rgb(64, 64, 64) !important
|
|
20
|
-
font-family: 'bootstrap-icons'
|
|
21
|
-
content: "\F671"
|
|
22
|
-
|
|
23
|
-
@include true.test-module('Flexbox Generator')
|
|
24
|
-
@include true.test('Generates flex-row properties')
|
|
25
|
-
@include true.assert
|
|
26
|
-
@include true.output
|
|
27
|
-
@include generators.flexbox-generator('flex-row')
|
|
28
|
-
|
|
29
|
-
@include true.expect
|
|
30
|
-
display: flex
|
|
31
|
-
flex-wrap: nowrap
|
|
32
|
-
flex-direction: row
|
|
33
|
-
|
|
34
|
-
@include true.test-module('Input Generator')
|
|
35
|
-
@include true.test('Generates text input type')
|
|
36
|
-
@include true.assert
|
|
37
|
-
@include true.output
|
|
38
|
-
@include generators.input-generator('text')
|
|
39
|
-
|
|
40
|
-
@include true.expect
|
|
41
|
-
input[type="text"]
|
|
42
|
-
border: rgb(204, 204, 204) solid 0.0625rem
|
|
43
|
-
padding: 0.5rem 1rem
|
|
44
|
-
border-radius: 0.5rem
|
|
45
|
-
background-color: rgb(255, 255, 255)
|
|
46
|
-
font-size: 1rem
|
|
47
|
-
line-height: 1.5
|
|
48
|
-
box-sizing: border-box
|
|
49
|
-
outline: 0.0625rem solid rgb(0, 120, 215)
|
|
50
|
-
focus-outline: rgb(0, 120, 215)
|
|
51
|
-
cursor: text
|
|
52
|
-
|
|
53
|
-
input[type="text"]::focus
|
|
54
|
-
outline: rgb(0, 120, 215)
|
|
55
|
-
|
|
56
|
-
&::-webkit-slider-runnable-track
|
|
57
|
-
height: 0.4rem
|
|
58
|
-
background: #ddd
|
|
59
|
-
border-radius: 0.2rem
|
|
60
|
-
|
|
61
|
-
&::-webkit-slider-thumb
|
|
62
|
-
-webkit-appearance: none
|
|
63
|
-
width: 1rem
|
|
64
|
-
height: 1rem
|
|
65
|
-
background: #0078d7
|
|
66
|
-
border-radius: 50%
|
|
67
|
-
margin-top: -0.3rem
|
|
68
|
-
|
|
69
|
-
@include true.test-module('Media Queries')
|
|
70
|
-
@include true.test('Generates max-width media query for breakpoint md')
|
|
71
|
-
@include true.assert
|
|
72
|
-
@include true.output
|
|
73
|
-
@include media.media-queries('md')
|
|
74
|
-
color: blue
|
|
75
|
-
|
|
76
|
-
@include true.expect
|
|
77
|
-
@media (max-width: 64rem)
|
|
78
|
-
color: blue
|
|
79
|
-
|
|
80
|
-
@include true.test('Generates prefers-color-scheme')
|
|
81
|
-
@include true.assert
|
|
82
|
-
@include true.output
|
|
83
|
-
@include media.prefers-color-scheme(dark)
|
|
84
|
-
background: black
|
|
85
|
-
|
|
86
|
-
@include true.expect
|
|
87
|
-
@media (prefers-color-scheme: dark)
|
|
88
|
-
background: black
|
|
89
|
-
|
|
90
|
-
@include true.test('Generates device-media for iphone')
|
|
91
|
-
@include true.assert
|
|
92
|
-
@include true.output
|
|
93
|
-
@include media.device-media('iphone')
|
|
94
|
-
color: white
|
|
95
|
-
|
|
96
|
-
@include true.expect
|
|
97
|
-
@media only screen and (min-width: 20rem) and (max-width: 20.125rem) and (min-height: 30rem) and (max-height: 30.125rem) and (orientation: portrait)
|
|
98
|
-
color: white
|
|
99
|
-
|
|
100
|
-
@include true.test-module('Typography')
|
|
101
|
-
@include true.test('Generates font styles')
|
|
102
|
-
@include true.assert
|
|
103
|
-
@include true.output
|
|
104
|
-
@include typo.font($size: 2rem, $weight: bold)
|
|
105
|
-
|
|
106
|
-
@include true.expect
|
|
107
|
-
font-size: 2rem
|
|
108
|
-
font-weight: bold
|
|
109
|
-
|
|
110
|
-
@include true.test('Generates sans-serif styles')
|
|
111
|
-
@include true.assert
|
|
112
|
-
@include true.output
|
|
113
|
-
@include typo.sans-serif('Roboto', $size: 1.5rem)
|
|
114
|
-
|
|
115
|
-
@include true.expect
|
|
116
|
-
font-family: "Roboto", sans-serif
|
|
117
|
-
font-size: 1.5rem
|
|
118
|
-
|
|
119
|
-
@include true.test('Generates serif styles')
|
|
120
|
-
@include true.assert
|
|
121
|
-
@include true.output
|
|
122
|
-
@include typo.serif('Georgia', $size: 1.2rem)
|
|
123
|
-
|
|
124
|
-
@include true.expect
|
|
125
|
-
font-family: "Georgia", serif
|
|
126
|
-
font-size: 1.2rem
|
|
127
|
-
|
|
128
|
-
@include true.test('Generates monospace styles')
|
|
129
|
-
@include true.assert
|
|
130
|
-
@include true.output
|
|
131
|
-
@include typo.monospace('Fira Code', $weight: 500)
|
|
132
|
-
|
|
133
|
-
@include true.expect
|
|
134
|
-
font-family: "Fira Code", monospace
|
|
135
|
-
font-size: 1rem
|
|
136
|
-
font-weight: 500
|
|
137
|
-
|
|
138
|
-
@include true.test('Returns correct font-family for known font')
|
|
139
|
-
@include true.assert-equal(typo.font-family-of('Open Sans'), sans-serif)
|
|
140
|
-
|
|
141
|
-
@include true.test('Detects generic category names')
|
|
142
|
-
@include true.assert-equal(typo.font-family-of('mono'), monospace)
|
|
143
|
-
@include true.assert-equal(typo.font-family-of('serif'), serif)
|
|
144
|
-
|
|
145
|
-
@include true.test('Provides fallbacks for unknown fonts in font-family-of')
|
|
146
|
-
@include true.assert-equal(typo.font-family-of('MyCustomFont'), ('Nunito', Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif))
|
|
147
|
-
|
|
148
|
-
@include true.test('Generates fallback for unknown font')
|
|
149
|
-
@include true.assert
|
|
150
|
-
@include true.output
|
|
151
|
-
@include typo.font('MyCustomFont')
|
|
152
|
-
|
|
153
|
-
@include true.expect
|
|
154
|
-
font-family: "MyCustomFont", "Nunito", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif
|
|
155
|
-
|
|
156
|
-
@include true.test('Generates fallback for unknown font')
|
|
157
|
-
@include true.assert
|
|
158
|
-
@include true.output
|
|
159
|
-
@include typo.font()
|
|
160
|
-
|
|
161
|
-
@include true.expect
|
|
162
|
-
font-family: "Nunito", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif
|
|
163
|
-
|
|
164
|
-
@include true.test('Does not overwrite explicit fallback override for unknown font')
|
|
165
|
-
@include true.assert
|
|
166
|
-
@include true.output
|
|
167
|
-
@include typo.font('MyCustomFont', $family: serif)
|
|
168
|
-
|
|
169
|
-
@include true.expect
|
|
170
|
-
font-family: "MyCustomFont", serif
|
|
171
|
-
|
|
172
|
-
@include true.test('Generates default fallback stack when no font is provided')
|
|
173
|
-
@include true.assert
|
|
174
|
-
@include true.output
|
|
175
|
-
@include typo.font()
|
|
176
|
-
|
|
177
|
-
@include true.expect
|
|
178
|
-
font-family: "Nunito", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif
|
|
179
|
-
font-size: 1rem
|
|
180
|
-
|
|
181
|
-
@include true.test('Generates default system sans-serif stack when no font is provided')
|
|
182
|
-
@include true.assert
|
|
183
|
-
@include true.output
|
|
184
|
-
@include typo.sans-serif()
|
|
185
|
-
|
|
186
|
-
@include true.expect
|
|
187
|
-
font-family: "Roboto", "Helvetica", "Arial", "Work Sans", "Nunito", "Open Sans", "Lato", "Montserrat", "Source Sans Pro", "Inter", "Tahoma", "Verdana", "Gill Sans", "Futura", "Ubuntu", "Noto Sans", "Noto Sans KR", "Noto Sans JP", "Noto Sans SC", "Noto Sans Arabic", "Noto Sans Hebrew", sans-serif
|
|
188
|
-
font-size: 1rem
|
|
189
|
-
|
|
190
|
-
@include true.test('Generates default system serif stack when no font is provided')
|
|
191
|
-
@include true.assert
|
|
192
|
-
@include true.output
|
|
193
|
-
@include typo.serif()
|
|
194
|
-
|
|
195
|
-
@include true.expect
|
|
196
|
-
font-family: "Georgia", "Times New Roman", "Palatino", "Libre Baskerville", "Merriweather", "PT Serif", "Noto Serif", "Noto Serif KR", "Noto Serif JP", "Noto Serif SC", serif
|
|
197
|
-
font-size: 1rem
|
|
198
|
-
|
|
199
|
-
@include true.test('Generates default system monospace stack when no font is provided')
|
|
200
|
-
@include true.assert
|
|
201
|
-
@include true.output
|
|
202
|
-
@include typo.monospace()
|
|
203
|
-
|
|
204
|
-
@include true.expect
|
|
205
|
-
font-family: "Courier New", "Consolas", "Ubuntu Mono", "Source Code Pro", "Fira Code", "Inconsolata", "Menlo", "Monaco", "Noto Mono", monospace
|
|
206
|
-
font-size: 1rem
|
|
207
|
-
|
|
208
|
-
@include true.test-module('Styling (Native)')
|
|
209
|
-
@include true.test('Applies typography font styling to figcaption')
|
|
210
|
-
@include true.assert
|
|
211
|
-
@include true.output
|
|
212
|
-
figure figcaption
|
|
213
|
-
@include typo.font($style: italic)
|
|
214
|
-
|
|
215
|
-
@include true.expect
|
|
216
|
-
figure figcaption
|
|
217
|
-
font-style: italic
|
|
218
|
-
|
|
219
|
-
@include true.test-module('Tags and Elements')
|
|
220
|
-
@include true.test('Applies background and text color')
|
|
221
|
-
@include true.assert
|
|
222
|
-
@include true.output
|
|
223
|
-
.custom-bg
|
|
224
|
-
@include misc-styling.background-color(rgb(255, 0, 0), rgb(255, 255, 255))
|
|
225
|
-
|
|
226
|
-
@include true.expect
|
|
227
|
-
.custom-bg
|
|
228
|
-
color: rgba(255, 255, 255, 1)
|
|
229
|
-
background-color: rgba(255, 0, 0, 1)
|
|
230
|
-
|
|
231
|
-
@include true.test('Applies base button styling')
|
|
232
|
-
@include true.assert
|
|
233
|
-
@include true.output
|
|
234
|
-
button
|
|
235
|
-
@include buttons.base-btn()
|
|
236
|
-
|
|
237
|
-
@include true.expect
|
|
238
|
-
button
|
|
239
|
-
border: none
|
|
240
|
-
margin: 0.5em
|
|
241
|
-
cursor: pointer
|
|
242
|
-
position: relative
|
|
243
|
-
padding: 0.5em 1.5em
|
|
244
|
-
border-radius: 0.5em
|
|
245
|
-
display: inline-block
|
|
246
|
-
transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), background-color 0.2s
|
|
247
|
-
color: rgb(255, 248, 241)
|
|
248
|
-
background-color: rgb(252, 245, 235)
|
|
249
|
-
font-size: 1em
|
|
250
|
-
font-weight: bold
|
|
251
|
-
font-style: normal
|
|
252
|
-
|
|
253
|
-
&:hover
|
|
254
|
-
transform: scale(1.05)
|
|
255
|
-
background-color: rgb(248.6739130435, 233.9130434783, 212.8260869565)
|
|
256
|
-
|
|
257
|
-
&:active
|
|
258
|
-
transform: scale(0.95)
|
|
259
|
-
background-color: rgb(245.347826087, 222.8260869565, 190.652173913)
|
|
260
|
-
|
|
261
|
-
&:disabled
|
|
262
|
-
opacity: 0.3
|
|
263
|
-
cursor: not-allowed
|
|
264
|
-
|
|
265
|
-
@include true.test('Applies link colors and properties')
|
|
266
|
-
@include true.assert
|
|
267
|
-
@include true.output
|
|
268
|
-
@include elements.link-color(rgb(0, 0, 255), rgb(0, 0, 200), rgb(0, 0, 150), rgb(128, 0, 128))
|
|
269
|
-
|
|
270
|
-
@include true.expect
|
|
271
|
-
a
|
|
272
|
-
color: rgb(0, 0, 255)
|
|
273
|
-
cursor: pointer
|
|
274
|
-
text-decoration: none
|
|
275
|
-
|
|
276
|
-
[aria-disabled="true"]
|
|
277
|
-
color: rgb(160, 160, 160)
|
|
278
|
-
cursor: not-allowed
|
|
279
|
-
pointer-events: none
|
|
280
|
-
text-decoration: none
|
|
281
|
-
|
|
282
|
-
&:active
|
|
283
|
-
color: rgb(0, 0, 150)
|
|
284
|
-
|
|
285
|
-
&.external-link
|
|
286
|
-
text-decoration: underline
|
|
287
|
-
|
|
288
|
-
@media (hover: hover)
|
|
289
|
-
&:hover
|
|
290
|
-
color: rgb(0, 0, 200)
|
|
291
|
-
border-radius: 0.5em
|
|
292
|
-
|
|
293
|
-
&:visited
|
|
294
|
-
color: rgb(128, 0, 128)
|
|
295
|
-
|
|
296
|
-
h1, h2, h3, h4, h5, h6
|
|
297
|
-
color: rgb(0, 0, 255) !important
|
|
298
|
-
|
|
299
|
-
@include true.report
|