lumina-sass 2.5.0 → 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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lumina-sass",
3
- "version": "2.5.0",
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/mixins.spec.sass src/test/mixins.spec.css",
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": [
@@ -6,6 +6,9 @@
6
6
  align-items: center
7
7
  @include mix.flexbox-generator('flex-row')
8
8
 
9
+ .flex-items-center
10
+ align-items: center
11
+ @include mix.flexbox-generator('flex')
9
12
  .flex-inline-flex-row
10
13
  @include mix.flexbox-generator('inline-flex-row')
11
14
 
@@ -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: (
@@ -94,15 +94,15 @@
94
94
 
95
95
  // Range track styling
96
96
  &::-webkit-slider-runnable-track
97
- height: 0.4rem
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
- width: 1rem
105
- height: 1rem
104
+ inline-size: 1rem
105
+ block-size: 1rem
106
106
  background: #0078d7
107
107
  border-radius: 50%
108
108
  margin-top: -0.3rem
@@ -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-width: $breakpoint-value)
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-width: $width) and (max-width: $max-width) and (min-height: $height) and (max-height: $max-height) and (orientation: portrait)
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-width: $height) and (max-width: $max-height) and (min-height: $width) and (max-height: $max-width) and (orientation: landscape)
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."
@@ -1,6 +1,8 @@
1
1
 
2
2
  @use 'sass:map'
3
3
  @use 'sass:list'
4
+ @use 'sass:meta'
5
+ @use 'sass:string'
4
6
  @use '../map/fonts' as fonts
5
7
 
6
8
  @mixin text-wrap-safe($inline: 0)
@@ -11,23 +13,26 @@
11
13
  overflow-wrap: anywhere
12
14
  min-inline-size: $inline
13
15
 
14
- @mixin font-style($font, $family: null, $line-height: null, $variant: null)
16
+ @mixin font( $font:null, $size: 1rem, $family: null, $style: null, $weight: null, $line-height: null, $variant: null)
15
17
  $detected-family: font-family-of($font)
16
18
 
17
- @if $detected-family != null
19
+ @if is-known-font($font)
18
20
  $family: $detected-family
21
+
22
+ @else if $family == null
23
+ $family: $detected-family
24
+ @if $font != null
25
+ @warn "Font '#{$font}' not found in configuration map. Defaulting to stack: '#{$font}', #{$family}."
19
26
 
20
- @if $line-height != null
21
- line-height: $line-height
22
-
23
- @if $variant != null
24
- font-variant: $variant
25
-
26
- font-family: $font, $family
27
+ @if meta.type-of($font) == 'list'
28
+ $last: list.nth($font, list.length($font))
29
+ @if $last == $family
30
+ $family: null
27
31
 
28
- @mixin font( $font:null, $size: 1rem, $family: null, $style: null, $weight: null, $line-height: null, $variant: null)
29
32
  @if $font != null
30
- @include font-style($font, $family, $line-height, $variant)
33
+ font-family: $font, $family
34
+ @else
35
+ font-family: $family
31
36
 
32
37
  @if $size != null
33
38
  font-size: $size
@@ -38,20 +43,52 @@
38
43
  @if $style != null
39
44
  font-style: $style
40
45
 
46
+ @if $line-height != null
47
+ line-height: $line-height
48
+
41
49
  @if $variant != null
42
50
  font-variant: $variant
43
51
 
44
- @mixin sans-serif($font, $size: 1rem, $weight: null, $style: null)
52
+ @function get-default-stack($category)
53
+ @if not map.has-key(fonts.$fonts, $category)
54
+ @return null
55
+ $map: map.get(fonts.$fonts, $category)
56
+ $keys: map.keys($map)
57
+ $generic: $category
58
+ @if $category == 'mono'
59
+ $generic: monospace
60
+ @return list.append($keys, $generic)
61
+
62
+ @mixin sans-serif($font: null, $size: 1rem, $weight: null, $style: null)
63
+ @if $font == null
64
+ $font: get-default-stack('sans-serif')
45
65
  @include font($font, $size, sans-serif, $style, $weight)
46
66
 
47
- @mixin serif($font, $size: 1rem, $weight: null, $style: null)
67
+ @mixin serif($font: null, $size: 1rem, $weight: null, $style: null)
68
+ @if $font == null
69
+ $font: get-default-stack('serif')
48
70
  @include font($font, $size, serif, $style, $weight)
49
71
 
50
- @mixin monospace($font, $size: 1rem, $weight: null, $style: null)
72
+ @mixin monospace($font: null, $size: 1rem, $weight: null, $style: null)
73
+ @if $font == null
74
+ $font: get-default-stack('mono')
51
75
  @include font($font, $size, monospace, $style, $weight)
52
76
 
77
+ @function is-known-font($font)
78
+ @if $font == null
79
+ @return false
80
+ @if map.has-key(fonts.$fonts, $font)
81
+ @return true
82
+ @each $category, $map in fonts.$fonts
83
+ @if map.has-key($map, $font)
84
+ @return true
85
+ @return false
86
+
53
87
  // Helper: return the generic family for a given font name using the fonts map.
54
88
  @function font-family-of($font)
89
+ @if $font == null
90
+ @return ('Nunito', Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif)
91
+
55
92
  @if map.has-key(fonts.$fonts, $font)
56
93
  @if $font == 'mono'
57
94
  @return monospace
@@ -60,7 +97,9 @@
60
97
  @each $category, $map in fonts.$fonts
61
98
  @if map.has-key($map, $font)
62
99
  @return map.get($map, $font)
63
- @return null
100
+
101
+ // Default fallback stack when font is not found
102
+ @return ('Nunito', Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif)
64
103
 
65
104
  @mixin text-adjustments($alignment: null, $decoration: null)
66
105
  @if $alignment != null
@@ -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,236 +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-module('Styling (Native)')
146
- @include true.test('Applies typography font styling to figcaption')
147
- @include true.assert
148
- @include true.output
149
- figure figcaption
150
- @include typo.font($style: italic)
151
-
152
- @include true.expect
153
- figure figcaption
154
- font-style: italic
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
-
236
- @include true.report