typey 1.0.0.beta.1 → 1.0.0.beta.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +100 -68
- data/stylesheets/typey/_font-size.scss +4 -4
- data/stylesheets/typey/_helpers.scss +8 -8
- data/stylesheets/typey/_line-height.scss +4 -4
- data/stylesheets/typey/_margin.scss +10 -10
- data/stylesheets/typey/_padding.scss +10 -10
- data/stylesheets/typey/_type-layout.scss +4 -4
- data/stylesheets/typey/_weight.scss +1 -1
- data/typey.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9dcc04d16cfb798142ac6db19f845d936d9f962f
|
4
|
+
data.tar.gz: cb5e434d8e4addc5e6aeab29ff23ce69f6d70ca3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 205b4e9089a69f10c04579acceda1bae7cfe2c04bbf229a1a86e787d7e265f607e98f7bd172fcaec435ebee6b0e48de364d1618d9f680a9122b0796b375ebc13
|
7
|
+
data.tar.gz: 2937370f717f1c4594781f32a383beb9871b9e3687e25b51a5387991e3825dc8835782c12b216b26c6c8c07e68b9b95a697fbb5f0502fa65c2e0d417727ecd31
|
data/README.md
CHANGED
@@ -1,18 +1,80 @@
|
|
1
1
|
# typey
|
2
2
|
Do typography better.
|
3
3
|
|
4
|
-
|
4
|
+
### Features
|
5
5
|
|
6
|
+
Supports outputting in rem, px, pt and em.
|
6
7
|
|
7
|
-
|
8
|
+
```sass
|
9
|
+
$base-unit: rem;
|
10
|
+
```
|
11
|
+
|
12
|
+
Define font sizes inside a sass map as t-shirt sizes.
|
13
|
+
|
14
|
+
```sass
|
15
|
+
$font-size: (
|
16
|
+
xl: 32px,
|
17
|
+
l: 24px,
|
18
|
+
m: 16px,
|
19
|
+
s: 14px,
|
20
|
+
);
|
21
|
+
|
22
|
+
h1 {
|
23
|
+
@include font-size(xl);
|
24
|
+
}
|
25
|
+
```
|
26
|
+
|
27
|
+
Automatic px fallbacks when using rem as the base unit.
|
28
|
+
|
29
|
+
```css
|
30
|
+
h1 {
|
31
|
+
font-size: 32px;
|
32
|
+
font-size: 2rem;
|
33
|
+
}
|
34
|
+
```
|
35
|
+
|
36
|
+
Easily convert px values to rem or em.
|
37
|
+
|
38
|
+
```sass
|
39
|
+
button {
|
40
|
+
@include font-size(29px);
|
41
|
+
}
|
42
|
+
```
|
43
|
+
|
44
|
+
```css
|
45
|
+
button {
|
46
|
+
font-size: 1.8125rem;
|
47
|
+
}
|
48
|
+
```
|
49
|
+
|
50
|
+
Define line-height, margin and padding as multiples of the base line height OR as static values.
|
51
|
+
|
52
|
+
```sass
|
53
|
+
h2 {
|
54
|
+
@include line-height(3);
|
55
|
+
@incude margin(10px 0);
|
56
|
+
}
|
57
|
+
```
|
58
|
+
|
59
|
+
Define font weights inside a sass map.
|
60
|
+
|
61
|
+
```sass
|
62
|
+
$font-weight: (
|
63
|
+
bold: 700,
|
64
|
+
normal: 400,
|
65
|
+
lighter: 200
|
66
|
+
);
|
8
67
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
68
|
+
strong {
|
69
|
+
font-weight: weight(bold)
|
70
|
+
}
|
71
|
+
```
|
72
|
+
|
73
|
+
Ready to go web safe font stacks that are easy to extend.
|
74
|
+
|
75
|
+
```sass
|
76
|
+
$your-font-stack: extend-font-stack("Open sans", $sans-serif-stack);
|
77
|
+
```
|
16
78
|
|
17
79
|
### Requirements
|
18
80
|
|
@@ -36,24 +98,6 @@ Vanilla Sass
|
|
36
98
|
* Terminal: 'git clone git@github.com:jptaranto/typey.git
|
37
99
|
* SCSS: `@import '../link_to_component_dir/typey/stylesheets/typey'`
|
38
100
|
|
39
|
-
### CSS units used in typey
|
40
|
-
|
41
|
-
`px`
|
42
|
-
|
43
|
-
By far the simplest unit you can use to size typography on the web. It translates very easily from mockups produced in a certain over-rated graphics suite. In typey, all base sizes are specified in `px` (or `pt`) and are automatically converted to your `$base-unit`.
|
44
|
-
|
45
|
-
`pt`
|
46
|
-
|
47
|
-
Translates equally well from design mockups as `px` but should be kept for use solely within print stylesheets. For the simplest approach when writing print stylesheets set your $base-unit as `pt` and define all base sizes as `pt`.
|
48
|
-
|
49
|
-
`rem`
|
50
|
-
|
51
|
-
Sets `font-size` as relative to the `html` element's `font-size` and allows you to resize fonts dynamically with media queries. It has one irritating caveat: no IE8 support! Fear not, typey can help.
|
52
|
-
|
53
|
-
`em`
|
54
|
-
|
55
|
-
In the way the `rem` unit is relative to the `html` element, `em` is relative to the parent `font-size`. It is supported in all browsers and also allows you to dynamically resize fonts with media queries. It can just get severely confusing when you have various nested elements - each with an `em` `font-size`. Typey functions and mixins accept a second parameter to help with this problem.
|
56
|
-
|
57
101
|
### Getting started
|
58
102
|
|
59
103
|
Just like in compass Vertical Rhythm we define our base font size and line height first. In typey, all sizes are defined in `px` or `pt` only.
|
@@ -81,31 +125,28 @@ Define the `$font-size` map using `px` (or `pt`) - which are easy to read and ke
|
|
81
125
|
|
82
126
|
```sass
|
83
127
|
$font-size: (
|
84
|
-
xxxl: 60px,
|
85
|
-
xxl: 46px,
|
86
128
|
xl: 32px,
|
87
129
|
l: 24px,
|
88
130
|
m: 16px,
|
89
131
|
s: 14px,
|
90
|
-
xs: 12px
|
91
132
|
);
|
92
133
|
```
|
93
134
|
|
94
135
|
### Line height and font sizing examples
|
95
136
|
|
96
|
-
The simplest way to set
|
137
|
+
The simplest way to set font size is via the `font-size` mixin.
|
97
138
|
|
98
139
|
```sass
|
99
140
|
h1 {
|
100
|
-
|
141
|
+
@include font-size(xl);
|
101
142
|
}
|
102
143
|
```
|
103
144
|
|
104
|
-
You can specify
|
145
|
+
You can specify line height as a multiple of `$base-line-height` (for a vertical rhythm approach).
|
105
146
|
|
106
147
|
```sass
|
107
148
|
h2 {
|
108
|
-
|
149
|
+
@include line-height(2);
|
109
150
|
}
|
110
151
|
```
|
111
152
|
|
@@ -113,20 +154,11 @@ Or for those finicky designs, you can just use a static `px` value for granular
|
|
113
154
|
|
114
155
|
```sass
|
115
156
|
h3 {
|
116
|
-
|
117
|
-
}
|
118
|
-
```
|
119
|
-
|
120
|
-
If you are using rem as a base unit for its super lovely font resizing abilities, `px` fallbacks are added automatically when using the `font-size()` and `line-height()` mixins. Both mixins support exactly the same parameters as their function counterparts.
|
121
|
-
|
122
|
-
```sass
|
123
|
-
h4 {
|
124
|
-
@include font-size(xl);
|
125
|
-
@include line-height(2);
|
157
|
+
@include line-height(35px);
|
126
158
|
}
|
127
159
|
```
|
128
160
|
|
129
|
-
|
161
|
+
And for short hand, do it all with the `type-layout` mixin.
|
130
162
|
|
131
163
|
```sass
|
132
164
|
h4 {
|
@@ -134,40 +166,39 @@ h4 {
|
|
134
166
|
}
|
135
167
|
```
|
136
168
|
|
137
|
-
When using `em` as your `$base-unit`, each
|
169
|
+
When using `em` as your `$base-unit`, each mixin accepts a `$context` parameter so your `em` value will be relative to it's parent or element `font-size`. The `$context` parameter can either accept a t-shirt size or a static value for granular control. See the reference section below for more information.
|
138
170
|
|
139
171
|
```sass
|
140
172
|
h4 {
|
141
|
-
|
173
|
+
@include type-layout(xl, 2);
|
142
174
|
|
143
175
|
span {
|
144
|
-
|
145
|
-
line-height: line-height(2, 14px);
|
176
|
+
@include type-layout(s, 2, xl);
|
146
177
|
}
|
147
178
|
}
|
148
179
|
```
|
149
180
|
|
150
181
|
### Margin and padding examples
|
151
182
|
|
152
|
-
The same
|
183
|
+
The same mixins that we have for `line-height` also exist for `margin` and `padding`, and works exactly the same way.
|
153
184
|
|
154
185
|
```sass
|
155
186
|
div {
|
156
|
-
margin-top
|
157
|
-
margin-right
|
158
|
-
margin-bottom
|
159
|
-
margin-left
|
187
|
+
@include margin-top(2);
|
188
|
+
@include margin-right(1);
|
189
|
+
@include margin-bottom(2);
|
190
|
+
@include margin-left(1);
|
160
191
|
}
|
161
192
|
|
162
193
|
form {
|
163
|
-
padding-top
|
164
|
-
padding-right
|
165
|
-
padding-bottom
|
166
|
-
padding-left
|
194
|
+
@include padding-top(2);
|
195
|
+
@include padding-right(1);
|
196
|
+
@include padding-bottom(2);
|
197
|
+
@include padding-left(1);
|
167
198
|
}
|
168
199
|
```
|
169
200
|
|
170
|
-
|
201
|
+
You can use regular CSS short hand too.
|
171
202
|
|
172
203
|
```sass
|
173
204
|
div {
|
@@ -176,16 +207,13 @@ div {
|
|
176
207
|
}
|
177
208
|
```
|
178
209
|
|
179
|
-
If you are using `em`, both the `margin()` and `padding()` functions/mixins accept a
|
210
|
+
If you are using `em`, both the `margin()` and `padding()` functions/mixins accept a ``$context` parameter.
|
180
211
|
|
181
212
|
```sass
|
182
213
|
div {
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
@include margin(1 2, s);
|
187
|
-
@include padding(1 2, s);
|
188
|
-
}
|
214
|
+
@include font-size(s)
|
215
|
+
@include margin(1 2, s);
|
216
|
+
@include padding(1 2, s);
|
189
217
|
}
|
190
218
|
```
|
191
219
|
|
@@ -486,13 +514,17 @@ The font stack variable to extend.
|
|
486
514
|
|
487
515
|
### Included font stacks
|
488
516
|
|
517
|
+
Three standard do-all stacks.
|
518
|
+
|
489
519
|
```sass
|
490
|
-
// Three standard do-all stacks.
|
491
520
|
$serif-stack: TimesNewRoman, "Times New Roman", Times, Baskerville, Georgia, serif;
|
492
521
|
$sans-serif-stack: "Helvetica Neue", Helvetica, Arial, sans-serif;
|
493
522
|
$monospaced-stack: "Courier New", Courier, "Lucida Sans Typewriter", "Lucida Typewriter", monospace;
|
523
|
+
```
|
494
524
|
|
495
|
-
|
525
|
+
Specific font stacks.
|
526
|
+
|
527
|
+
```sass
|
496
528
|
$arial-stack: Arial, "Helvetica Neue", Helvetica, sans-serif;
|
497
529
|
$helvetica-stack: "Helvetica Neue", Helvetica, Arial, sans-serif;
|
498
530
|
$baskerville-stack: Baskerville, "Baskerville Old Face", "Hoefler Text", Garamond, "Times New Roman", serif;
|
@@ -11,10 +11,10 @@
|
|
11
11
|
// @return number
|
12
12
|
// The selected font-size in $base-unit.
|
13
13
|
@function font-size($size, $context: $base-font-size) {
|
14
|
-
@if type-of($size) ==
|
14
|
+
@if type-of($size) == "string" {
|
15
15
|
@return output-from-font-size-map($size, $context);
|
16
16
|
}
|
17
|
-
@if type-of($size) ==
|
17
|
+
@if type-of($size) == "number" and not unitless($size) {
|
18
18
|
@if unit($size) == unit($base-font-size) {
|
19
19
|
@return convert-unit($size, $context);
|
20
20
|
}
|
@@ -38,11 +38,11 @@
|
|
38
38
|
@mixin font-size($size, $context: $base-font-size) {
|
39
39
|
@if $base-unit == rem {
|
40
40
|
@if $rem-fallback == true {
|
41
|
-
@if type-of($size) ==
|
41
|
+
@if type-of($size) == "string" {
|
42
42
|
$map-size: map-get($font-size, $size);
|
43
43
|
font-size: $map-size;
|
44
44
|
}
|
45
|
-
@if type-of($size) ==
|
45
|
+
@if type-of($size) == "number" and not unitless($size) {
|
46
46
|
@if unit($size) == unit($base-font-size) {
|
47
47
|
font-size: $size;
|
48
48
|
}
|
@@ -28,7 +28,7 @@
|
|
28
28
|
// @return number
|
29
29
|
// The number without the unit.
|
30
30
|
@function strip-unit($number) {
|
31
|
-
@if type-of($number) ==
|
31
|
+
@if type-of($number) == "number" and not unitless($number) {
|
32
32
|
@return $number / ($number * 0 + 1);
|
33
33
|
}
|
34
34
|
@return $number;
|
@@ -46,7 +46,7 @@
|
|
46
46
|
// @return number
|
47
47
|
// The number converted to the base unit.
|
48
48
|
@function convert-unit($number, $context: $base-font-size) {
|
49
|
-
@if type-of($number) ==
|
49
|
+
@if type-of($number) == "number" and not unitless($number) {
|
50
50
|
$unit: unit($number);
|
51
51
|
@if $unit == px or $unit == pt {
|
52
52
|
@if $base-unit == rem {
|
@@ -61,7 +61,7 @@
|
|
61
61
|
@return output-unit(strip-unit($number));
|
62
62
|
}
|
63
63
|
@if $base-unit == em {
|
64
|
-
@if type-of($context) ==
|
64
|
+
@if type-of($context) == "string" {
|
65
65
|
@if map-has-key($font-size, $context) {
|
66
66
|
$context-map-size: map-get($font-size, $context);
|
67
67
|
@return output-unit(($number / $context-map-size));
|
@@ -70,7 +70,7 @@
|
|
70
70
|
@error "'#{$context}' not found in $font-size map.";
|
71
71
|
}
|
72
72
|
}
|
73
|
-
@if type-of($context) ==
|
73
|
+
@if type-of($context) == "number" {
|
74
74
|
@if unit($context) == unit($base-font-size) {
|
75
75
|
@return output-unit(($number / $context));
|
76
76
|
}
|
@@ -105,7 +105,7 @@
|
|
105
105
|
@return output-unit(strip-unit($x * $base-line-height));
|
106
106
|
}
|
107
107
|
@if $base-unit == em {
|
108
|
-
@if type-of($context) ==
|
108
|
+
@if type-of($context) == "number" {
|
109
109
|
@if unit($context) == unit($base-font-size) {
|
110
110
|
@return output-unit(($x * $base-line-height) / $context);
|
111
111
|
}
|
@@ -113,7 +113,7 @@
|
|
113
113
|
@error "The unit used for $context does not match the $base-font-size unit.";
|
114
114
|
}
|
115
115
|
}
|
116
|
-
@if type-of($context) ==
|
116
|
+
@if type-of($context) == "string" {
|
117
117
|
@if map-has-key($font-size, $context) {
|
118
118
|
$context-map-size: map-get($font-size, $context);
|
119
119
|
@return output-unit(($x * $base-line-height) / $context-map-size);
|
@@ -151,7 +151,7 @@
|
|
151
151
|
@return output-unit(strip-unit($map-size));
|
152
152
|
}
|
153
153
|
@if $base-unit == em {
|
154
|
-
@if type-of($context) ==
|
154
|
+
@if type-of($context) == "string" {
|
155
155
|
@if map-has-key($font-size, $context) {
|
156
156
|
$context-map-size: map-get($font-size, $context);
|
157
157
|
@return output-unit(($map-size / $context-map-size));
|
@@ -160,7 +160,7 @@
|
|
160
160
|
@error "'#{$context}' not found in $font-size map.";
|
161
161
|
}
|
162
162
|
}
|
163
|
-
@if type-of($context) ==
|
163
|
+
@if type-of($context) == "number" {
|
164
164
|
@if unit($context) == unit($base-font-size) {
|
165
165
|
@return output-unit(($map-size / $context));
|
166
166
|
}
|
@@ -17,10 +17,10 @@
|
|
17
17
|
// @return number
|
18
18
|
// The calculated height in $base-unit.
|
19
19
|
@function line-height($x, $context: $base-font-size) {
|
20
|
-
@if type-of($x) ==
|
20
|
+
@if type-of($x) == "number" and unitless($x) {
|
21
21
|
@return output-from-multiplier($x, $context);
|
22
22
|
}
|
23
|
-
@if type-of($x) ==
|
23
|
+
@if type-of($x) == "number" and not unitless($x) {
|
24
24
|
@if unit($x) == unit($base-font-size) {
|
25
25
|
@return convert-unit($x, $context);
|
26
26
|
}
|
@@ -46,10 +46,10 @@
|
|
46
46
|
@mixin line-height($x, $context: $base-font-size) {
|
47
47
|
@if $base-unit == rem {
|
48
48
|
@if $rem-fallback == true {
|
49
|
-
@if type-of($x) ==
|
49
|
+
@if type-of($x) == "number" and unitless($x) {
|
50
50
|
line-height: $x * $base-line-height;
|
51
51
|
}
|
52
|
-
@if type-of($x) ==
|
52
|
+
@if type-of($x) == "number" and not unitless($x) {
|
53
53
|
line-height: $x;
|
54
54
|
}
|
55
55
|
}
|
@@ -37,11 +37,11 @@
|
|
37
37
|
$converted-list: ();
|
38
38
|
@each $x in $list {
|
39
39
|
@if $base-unit == rem {
|
40
|
-
@if type-of($x) ==
|
40
|
+
@if type-of($x) == "number" and unitless($x) {
|
41
41
|
$margin: $x * $base-line-height;
|
42
42
|
$px-list: join($px-list, $margin, $separator: space);
|
43
43
|
}
|
44
|
-
@if type-of($x) ==
|
44
|
+
@if type-of($x) == "number" and not unitless($x) {
|
45
45
|
$px-list: join($px-list, $x, $separator: space);
|
46
46
|
}
|
47
47
|
}
|
@@ -69,10 +69,10 @@
|
|
69
69
|
@mixin margin-top($x, $context: $base-font-size) {
|
70
70
|
@if $base-unit == rem {
|
71
71
|
@if $rem-fallback == true {
|
72
|
-
@if type-of($x) ==
|
72
|
+
@if type-of($x) == "number" and unitless($x) {
|
73
73
|
margin-top: $x * $base-line-height;
|
74
74
|
}
|
75
|
-
@if type-of($x) ==
|
75
|
+
@if type-of($x) == "number" and not unitless($x) {
|
76
76
|
margin-top: $x;
|
77
77
|
}
|
78
78
|
}
|
@@ -93,10 +93,10 @@
|
|
93
93
|
@mixin margin-bottom($x, $context: $base-font-size) {
|
94
94
|
@if $base-unit == rem {
|
95
95
|
@if $rem-fallback == true {
|
96
|
-
@if type-of($x) ==
|
96
|
+
@if type-of($x) == "number" and unitless($x) {
|
97
97
|
margin-bottom: $x * $base-line-height;
|
98
98
|
}
|
99
|
-
@if type-of($x) ==
|
99
|
+
@if type-of($x) == "number" and not unitless($x) {
|
100
100
|
margin-bottom: $x;
|
101
101
|
}
|
102
102
|
}
|
@@ -117,10 +117,10 @@
|
|
117
117
|
@mixin margin-left($x, $context: $base-font-size) {
|
118
118
|
@if $base-unit == rem {
|
119
119
|
@if $rem-fallback == true {
|
120
|
-
@if type-of($x) ==
|
120
|
+
@if type-of($x) == "number" and unitless($x) {
|
121
121
|
margin-left: $x * $base-line-height;
|
122
122
|
}
|
123
|
-
@if type-of($x) ==
|
123
|
+
@if type-of($x) == "number" and not unitless($x) {
|
124
124
|
margin-left: $x;
|
125
125
|
}
|
126
126
|
}
|
@@ -141,10 +141,10 @@
|
|
141
141
|
@mixin margin-right($x, $context: $base-font-size) {
|
142
142
|
@if $base-unit == rem {
|
143
143
|
@if $rem-fallback == true {
|
144
|
-
@if type-of($x) ==
|
144
|
+
@if type-of($x) == "number" and unitless($x) {
|
145
145
|
margin-right: $x * $base-line-height;
|
146
146
|
}
|
147
|
-
@if type-of($x) ==
|
147
|
+
@if type-of($x) == "number" and not unitless($x) {
|
148
148
|
margin-right: $x;
|
149
149
|
}
|
150
150
|
}
|
@@ -37,11 +37,11 @@
|
|
37
37
|
$converted-list: ();
|
38
38
|
@each $x in $list {
|
39
39
|
@if $base-unit == rem {
|
40
|
-
@if type-of($x) ==
|
40
|
+
@if type-of($x) == "number" and unitless($x) {
|
41
41
|
$padding: $x * $base-line-height;
|
42
42
|
$px-list: join($px-list, $padding, $separator: space);
|
43
43
|
}
|
44
|
-
@if type-of($x) ==
|
44
|
+
@if type-of($x) == "number" and not unitless($x) {
|
45
45
|
$px-list: join($px-list, $x, $separator: space);
|
46
46
|
}
|
47
47
|
}
|
@@ -69,10 +69,10 @@
|
|
69
69
|
@mixin padding-top($x, $context: $base-font-size) {
|
70
70
|
@if $base-unit == rem {
|
71
71
|
@if $rem-fallback == true {
|
72
|
-
@if type-of($x) ==
|
72
|
+
@if type-of($x) == "number" and unitless($x) {
|
73
73
|
padding-top: $x * $base-line-height;
|
74
74
|
}
|
75
|
-
@if type-of($x) ==
|
75
|
+
@if type-of($x) == "number" and not unitless($x) {
|
76
76
|
padding-top: $x;
|
77
77
|
}
|
78
78
|
}
|
@@ -93,10 +93,10 @@
|
|
93
93
|
@mixin padding-bottom($x, $context: $base-font-size) {
|
94
94
|
@if $base-unit == rem {
|
95
95
|
@if $rem-fallback == true {
|
96
|
-
@if type-of($x) ==
|
96
|
+
@if type-of($x) == "number" and unitless($x) {
|
97
97
|
padding-bottom: $x * $base-line-height;
|
98
98
|
}
|
99
|
-
@if type-of($x) ==
|
99
|
+
@if type-of($x) == "number" and not unitless($x) {
|
100
100
|
padding-bottom: $x;
|
101
101
|
}
|
102
102
|
}
|
@@ -117,10 +117,10 @@
|
|
117
117
|
@mixin padding-left($x, $context: $base-font-size) {
|
118
118
|
@if $base-unit == rem {
|
119
119
|
@if $rem-fallback == true {
|
120
|
-
@if type-of($x) ==
|
120
|
+
@if type-of($x) == "number" and unitless($x) {
|
121
121
|
padding-left: $x * $base-line-height;
|
122
122
|
}
|
123
|
-
@if type-of($x) ==
|
123
|
+
@if type-of($x) == "number" and not unitless($x) {
|
124
124
|
padding-left: $x;
|
125
125
|
}
|
126
126
|
}
|
@@ -141,10 +141,10 @@
|
|
141
141
|
@mixin padding-right($x, $context: $base-font-size) {
|
142
142
|
@if $base-unit == rem {
|
143
143
|
@if $rem-fallback == true {
|
144
|
-
@if type-of($x) ==
|
144
|
+
@if type-of($x) == "number" and unitless($x) {
|
145
145
|
padding-right: $x * $base-line-height;
|
146
146
|
}
|
147
|
-
@if type-of($x) ==
|
147
|
+
@if type-of($x) == "number" and not unitless($x) {
|
148
148
|
padding-right: $x;
|
149
149
|
}
|
150
150
|
}
|
@@ -11,11 +11,11 @@
|
|
11
11
|
@mixin type-layout($size, $x, $context: $size) {
|
12
12
|
@if $base-unit == rem {
|
13
13
|
@if $rem-fallback == true {
|
14
|
-
@if type-of($size) ==
|
14
|
+
@if type-of($size) == "string" {
|
15
15
|
$map-size: map-get($font-size, $size);
|
16
16
|
font-size: $map-size;
|
17
17
|
}
|
18
|
-
@if type-of($size) ==
|
18
|
+
@if type-of($size) == "number" and not unitless($size) {
|
19
19
|
$unit: unit($size);
|
20
20
|
@if $unit == px or $unit == pt {
|
21
21
|
font-size: $size;
|
@@ -24,10 +24,10 @@
|
|
24
24
|
@warn "font-size() only accepts values in px or pt.";
|
25
25
|
}
|
26
26
|
}
|
27
|
-
@if type-of($x) ==
|
27
|
+
@if type-of($x) == "number" and unitless($x) {
|
28
28
|
line-height: $x * $base-line-height;
|
29
29
|
}
|
30
|
-
@if type-of($x) ==
|
30
|
+
@if type-of($x) == "number" and not unitless($x) {
|
31
31
|
line-height: $x;
|
32
32
|
}
|
33
33
|
}
|
data/typey.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: typey
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0.beta.
|
4
|
+
version: 1.0.0.beta.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jack Taranto
|
@@ -64,7 +64,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
64
64
|
- !ruby/object:Gem::Version
|
65
65
|
version: 1.3.1
|
66
66
|
requirements: []
|
67
|
-
rubyforge_project: 1.0.0.beta.
|
67
|
+
rubyforge_project: 1.0.0.beta.2
|
68
68
|
rubygems_version: 2.4.6
|
69
69
|
signing_key:
|
70
70
|
specification_version: 4
|