lumina-sass 2.3.0 → 2.3.1
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/mix/_typography.sass +12 -9
- package/src/test/mixins.spec.sass +6 -12
package/package.json
CHANGED
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.
|
|
@@ -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)
|