type-heading 0.0.13 → 0.0.14
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.
- checksums.yaml +4 -4
- data/README.md +28 -12
- data/stylesheets/type-heading/_settings.scss +57 -24
- data/stylesheets/type-heading/functions/_core.scss +67 -32
- data/stylesheets/type-heading/functions/_heading.scss +99 -102
- data/stylesheets/type-heading/functions/_helpers.scss +336 -267
- data/stylesheets/type-heading/functions/_property.scss +288 -296
- data/stylesheets/type-heading/mixins/_breakpoint.scss +19 -20
- data/stylesheets/type-heading/mixins/_core.scss +148 -31
- data/stylesheets/type-heading/mixins/_heading.scss +65 -144
- data/stylesheets/type-heading/mixins/_property.scss +237 -129
- metadata +2 -2
@@ -1,149 +1,257 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
1
|
+
////
|
2
|
+
/// Property
|
3
|
+
/// @group Property
|
4
|
+
////
|
5
5
|
|
6
|
-
//
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
6
|
+
// th-property()
|
7
|
+
/// Output heading property style.
|
8
|
+
///
|
9
|
+
/// @since 0.0.14
|
10
|
+
///
|
11
|
+
/// @param {list | string} $heading - A heading map key or list.
|
12
|
+
/// @param {string} $property-name - (font-size | line-height | margin-top | margin-bottom | breakpoint) A heading property name.
|
13
|
+
/// @param {number} $breakpoint [false] - A heading list breakpoint.
|
14
|
+
/// @param {boolean | string} $convert [true] - (true | false | px | em | rem | rel | percent) If returned value should be unit converted or overridden.
|
15
|
+
/// @param {number} $base-font-size [$th-base-font-size] - Font size used for relative calculations.
|
16
|
+
///
|
17
|
+
/// @example scss - Output h1 font size styles.
|
18
|
+
/// @include th-property-font-size(h1)
|
19
|
+
/// @example scss - Output h1 font size styles with 768px breakpoint.
|
20
|
+
/// @include th-property-font-size(
|
21
|
+
/// $heading: h1,
|
22
|
+
/// $breakpoint: 768px
|
23
|
+
/// )
|
24
|
+
/// @example scss - Output h1 font size styles without unit conversion.
|
25
|
+
/// @include th-property(
|
26
|
+
/// $heading: h1,
|
27
|
+
/// $property-name: font-size,
|
28
|
+
/// $convert: false
|
29
|
+
/// )
|
30
|
+
/// @example scss - Output h1 font size styles and unit override to percent.
|
31
|
+
/// @include th-property(
|
32
|
+
/// $heading: h1,
|
33
|
+
/// $property-name: font-size,
|
34
|
+
/// $convert: percent
|
35
|
+
/// )
|
36
|
+
/// @example scss - Output h1 font size styles with a base font size of 24px.
|
37
|
+
/// @include th-property(
|
38
|
+
/// $heading: h1,
|
39
|
+
/// $property-name: font-size,
|
40
|
+
/// $base-font-size: 24px
|
41
|
+
/// )
|
42
|
+
|
43
|
+
@mixin th-property(
|
44
|
+
$heading,
|
45
|
+
$property-name,
|
46
|
+
$breakpoint: false,
|
47
|
+
$convert: true,
|
48
|
+
$base-font-size: $th-base-font-size
|
49
|
+
){
|
50
|
+
@if font-size != $property-name {
|
51
|
+
$base-font-size: _th-property-base($heading, $breakpoint, $base-font-size);
|
52
|
+
}
|
53
|
+
@if th-list-has($_th-core-properties, $property-name) {
|
54
|
+
$breakpoint: _th-core-breakpoint-context($breakpoint);
|
55
|
+
#{$property-name}: call(th-property-#{$property-name},
|
56
|
+
$heading: $heading,
|
57
|
+
$breakpoint: $breakpoint,
|
58
|
+
$convert: $convert,
|
59
|
+
$base-font-size: $base-font-size
|
60
|
+
);
|
61
|
+
}
|
62
|
+
}
|
63
|
+
|
64
|
+
// th-property-font-size()
|
65
|
+
/// Output heading font size styles.
|
66
|
+
///
|
67
|
+
/// @since 0.0.10
|
68
|
+
///
|
69
|
+
/// @param {string} $heading - A heading map key.
|
70
|
+
/// @param {number | boolean} $breakpoint [false] - A heading list breakpoint.
|
71
|
+
/// @param {boolean | string} $convert [true] - (false | px | em | rem | rel | percent) - If returned value should be unit converted or overridden.
|
72
|
+
/// @param {number} $base-font-size [$th-base-font-size] - Font size used for relative calculations.
|
73
|
+
///
|
74
|
+
/// @example scss - Output h1 font size styles.
|
75
|
+
/// @include th-property-font-size(h1)
|
76
|
+
/// @example scss - Output h1 font size styles with 768px breakpoint.
|
77
|
+
/// @include th-property-font-size(
|
78
|
+
/// $heading: h1,
|
79
|
+
/// $breakpoint: 768px
|
80
|
+
/// )
|
81
|
+
/// @example scss - Output h1 font size styles without unit conversion.
|
82
|
+
/// @include th-property-font-size(
|
83
|
+
/// $heading: h1,
|
84
|
+
/// $convert: false
|
85
|
+
/// )
|
86
|
+
/// @example scss - Output h1 font size styles and unit override to percent.
|
87
|
+
/// @include th-property-font-size(
|
88
|
+
/// $heading: h1,
|
89
|
+
/// $convert: percent
|
90
|
+
/// )
|
91
|
+
/// @example scss - Output h1 font size with a base font size of 24px.
|
92
|
+
/// @include th-property-font-size(
|
93
|
+
/// $heading: h1,
|
94
|
+
/// $base-font-size: 24px
|
95
|
+
/// )
|
27
96
|
|
28
97
|
@mixin th-property-font-size(
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
98
|
+
$heading,
|
99
|
+
$breakpoint: false,
|
100
|
+
$convert: true,
|
101
|
+
$base-font-size: $th-base-font-size
|
33
102
|
){
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
103
|
+
@include th-property(
|
104
|
+
$property-name: font-size,
|
105
|
+
$heading: $heading,
|
106
|
+
$breakpoint: $breakpoint,
|
107
|
+
$convert: $convert,
|
108
|
+
$base-font-size: $base-font-size
|
109
|
+
);
|
41
110
|
}
|
42
111
|
|
43
|
-
//
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
112
|
+
// th-property-line-height()
|
113
|
+
/// Output heading line height styles.
|
114
|
+
///
|
115
|
+
/// @since 0.0.10
|
116
|
+
///
|
117
|
+
/// @param {string} $heading - A heading map key.
|
118
|
+
/// @param {number | boolean} $breakpoint [false] - A heading list breakpoint.
|
119
|
+
/// @param {boolean | string} $convert [true] - (false | px | em | rem | rel | percent) If returned value should be unit converted or overridden.
|
120
|
+
/// @param {number} $base-font-size [$th-base-font-size] - Font size used for relative calculations.
|
121
|
+
///
|
122
|
+
/// @example scss - Output h1 line height styles.
|
123
|
+
/// @include th-property-line-height(h1)
|
124
|
+
/// @example scss - Output h1 line height styles with 768px breakpoint.
|
125
|
+
/// @include th-property-line-height(
|
126
|
+
/// $heading: h1,
|
127
|
+
/// $breakpoint: 768px
|
128
|
+
/// )
|
129
|
+
/// @example scss - Output h1 line height styles without unit conversion.
|
130
|
+
/// @include th-property-line-height(
|
131
|
+
/// $heading: h1,
|
132
|
+
/// $convert: false
|
133
|
+
/// )
|
134
|
+
/// @example scss - Output h1 line height styles and unit override to percent.
|
135
|
+
/// @include th-property-line-height(
|
136
|
+
/// $heading: h1,
|
137
|
+
/// $convert: percent
|
138
|
+
/// )
|
139
|
+
/// @example scss - Output h1 line height with a base font size of 24px.
|
140
|
+
/// @include th-property-line-height(
|
141
|
+
/// $heading: h1,
|
142
|
+
/// $base-font-size: 24px
|
143
|
+
/// )
|
63
144
|
|
64
145
|
@mixin th-property-line-height(
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
146
|
+
$heading,
|
147
|
+
$breakpoint: false,
|
148
|
+
$convert: true,
|
149
|
+
$base-font-size: $th-base-font-size
|
69
150
|
){
|
70
|
-
$
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
151
|
+
$base-font-size: _th-property-base($heading, $breakpoint, $base-font-size);
|
152
|
+
@include th-property(
|
153
|
+
$property-name: line-height,
|
154
|
+
$heading: $heading,
|
155
|
+
$breakpoint: $breakpoint,
|
156
|
+
$convert: $convert,
|
157
|
+
$base-font-size: $base-font-size
|
158
|
+
);
|
77
159
|
}
|
78
160
|
|
79
|
-
//
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
161
|
+
// th-property-margin-top()
|
162
|
+
/// Output heading margin top styles.
|
163
|
+
///
|
164
|
+
/// @since 0.0.10
|
165
|
+
///
|
166
|
+
/// @param {string} $heading - A heading map key.
|
167
|
+
/// @param {number | boolean} $breakpoint [false] - A heading list breakpoint.
|
168
|
+
/// @param {boolean | string} $convert [true] - (false | px | em | rem | rel | percent) If returned value should be unit converted or overridden.
|
169
|
+
/// @param {number} $base-font-size [$th-base-font-size] - Font size used for relative calculations.
|
170
|
+
///
|
171
|
+
/// @example scss - Output h1 margin top styles.
|
172
|
+
/// @include th-property-margin-top(h1)
|
173
|
+
/// @example scss - Output h1 margin top styles with 768px breakpoint.
|
174
|
+
/// @include th-property-margin-top(
|
175
|
+
/// $heading: h1,
|
176
|
+
/// $breakpoint: 768px
|
177
|
+
/// )
|
178
|
+
/// @example scss - Output h1 margin top styles without unit conversion.
|
179
|
+
/// @include th-property-margin-top(
|
180
|
+
/// $heading: h1,
|
181
|
+
/// $convert: false
|
182
|
+
/// )
|
183
|
+
/// @example scss - Output h1 margin top styles and unit override to percent.
|
184
|
+
/// @include th-property-margin-top(
|
185
|
+
/// $heading: h1,
|
186
|
+
/// $convert: percent
|
187
|
+
/// )
|
188
|
+
/// @example scss - Output h1 margin top with a base font size of 24px.
|
189
|
+
/// @include th-property-margin-top(
|
190
|
+
/// $heading: h1,
|
191
|
+
/// $base-font-size: 24px
|
192
|
+
/// )
|
99
193
|
|
100
194
|
@mixin th-property-margin-top(
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
195
|
+
$heading,
|
196
|
+
$breakpoint: false,
|
197
|
+
$convert: true,
|
198
|
+
$base-font-size: $th-base-font-size
|
105
199
|
){
|
106
|
-
$
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
200
|
+
$base-font-size: _th-property-base($heading, $breakpoint, $base-font-size);
|
201
|
+
@include th-property(
|
202
|
+
$property-name: margin-top,
|
203
|
+
$heading: $heading,
|
204
|
+
$breakpoint: $breakpoint,
|
205
|
+
$convert: $convert,
|
206
|
+
$base-font-size: $base-font-size
|
207
|
+
);
|
113
208
|
}
|
114
209
|
|
115
|
-
//
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
210
|
+
// th-property-margin-bottom()
|
211
|
+
/// Output heading margin bottom styles.
|
212
|
+
///
|
213
|
+
/// @since 0.0.10
|
214
|
+
///
|
215
|
+
/// @param {string} $heading - A heading map key.
|
216
|
+
/// @param {number | boolean} $breakpoint [false] - A heading list breakpoint.
|
217
|
+
/// @param {boolean | string} $convert [true] - (false | px | em | rem | rel | percent) If returned value should be unit converted or overridden.
|
218
|
+
/// @param {number} $base-font-size [$th-base-font-size] - Font size used for relative calculations.
|
219
|
+
///
|
220
|
+
/// @example scss - Output h1 margin bottom styles.
|
221
|
+
/// @include th-property-margin-bottom(h1)
|
222
|
+
/// @example scss - Output h1 margin bottom styles with 768px breakpoint.
|
223
|
+
/// @include th-property-margin-bottom(
|
224
|
+
/// $heading: h1,
|
225
|
+
/// $breakpoint: 768px
|
226
|
+
/// )
|
227
|
+
/// @example scss - Output h1 margin bottom styles without unit conversion.
|
228
|
+
/// @include th-property-margin-bottom(
|
229
|
+
/// $heading: h1,
|
230
|
+
/// $convert: false
|
231
|
+
/// )
|
232
|
+
/// @example scss - Output h1 margin bottom styles and unit override to percent.
|
233
|
+
/// @include th-property-margin-bottom(
|
234
|
+
/// $heading: h1,
|
235
|
+
/// $convert: percent
|
236
|
+
/// )
|
237
|
+
/// @example scss - Output h1 margin bottom with a base font size of 24px.
|
238
|
+
/// @include th-property-margin-bottom(
|
239
|
+
/// $heading: h1,
|
240
|
+
/// $base-font-size: 24px
|
241
|
+
/// )
|
135
242
|
|
136
243
|
@mixin th-property-margin-bottom(
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
244
|
+
$heading,
|
245
|
+
$breakpoint: false,
|
246
|
+
$convert: true,
|
247
|
+
$base-font-size: $th-base-font-size
|
141
248
|
){
|
142
|
-
$
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
249
|
+
$base-font-size: _th-property-base($heading, $breakpoint, $base-font-size);
|
250
|
+
@include th-property(
|
251
|
+
$property-name: margin-bottom,
|
252
|
+
$heading: $heading,
|
253
|
+
$breakpoint: $breakpoint,
|
254
|
+
$convert: $convert,
|
255
|
+
$base-font-size: $base-font-size
|
256
|
+
);
|
149
257
|
}
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: type-heading
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Elliot Mitchum
|
@@ -92,7 +92,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
92
92
|
version: '0'
|
93
93
|
requirements: []
|
94
94
|
rubyforge_project:
|
95
|
-
rubygems_version: 2.4.
|
95
|
+
rubygems_version: 2.4.8
|
96
96
|
signing_key:
|
97
97
|
specification_version: 4
|
98
98
|
summary: A responsive typography tool.
|