typey 1.0.0.beta.7 → 1.0.0.beta.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +7 -11
- data/stylesheets/typey/_defaults.scss +2 -2
- data/stylesheets/typey/functions/_em-calculators.scss +4 -4
- data/stylesheets/typey/functions/_helpers.scss +21 -0
- data/stylesheets/typey/mixins/_define-type-sizing.scss +2 -6
- data/typey.gemspec +3 -3
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5cf8fab7e972467e5f8ebac592d89f934a1a764e
|
4
|
+
data.tar.gz: 6abd15dd136bfcc0bd600c4c98e3aea2c3447134
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 038e6ac7bfc702ce2b62ad88cb062ab9e5346d81f99412c7c22a291e9256879299c59f43c725be516d68e0e691faa19cf51e449b6f1d5d74ec93cfb467bdf607
|
7
|
+
data.tar.gz: abf9060ea87ff824df68b52d80eb61f9d4f4377686ff6cc34abb7a52ca7152ad1bc7fde83254fb23778a01f2f6dabeea3c856c219c41ce5b4390bc2f896e17a7
|
data/README.md
CHANGED
@@ -21,7 +21,7 @@ Bower
|
|
21
21
|
|
22
22
|
Vanilla Sass
|
23
23
|
|
24
|
-
* Terminal:
|
24
|
+
* Terminal: `git clone git@github.com:jptaranto/typey.git`
|
25
25
|
* SCSS: `@import '../link_to_component_dir/typey/stylesheets/typey'`
|
26
26
|
|
27
27
|
## Getting started
|
@@ -50,11 +50,11 @@ Just like in compass Vertical Rhythm we define our base font size and line heigh
|
|
50
50
|
|
51
51
|
```sass
|
52
52
|
$base-font-size: 16px;
|
53
|
-
$base-line-height:
|
53
|
+
$base-line-height: 24px;
|
54
54
|
```
|
55
55
|
|
56
56
|
Ok, so we have our base sizing, now we need to choose the approach that we are going
|
57
|
-
to layout type with. We have two options available to us: rhythm and ratio
|
57
|
+
to layout type with. We have two options available to us: `rhythm` and `ratio`. Rhythm
|
58
58
|
allows us to specify line-heights as a multiple of $base-line-height, where as ratio
|
59
59
|
allows us to specify line-heights as a multiple of our elements font-size. Rhythm is
|
60
60
|
the default, but for beginners working with web typography the simplest approach
|
@@ -62,11 +62,7 @@ is to use ratio. Each example below will tell you which method it is for.
|
|
62
62
|
|
63
63
|
```sass
|
64
64
|
$line-height-method: rhythm;
|
65
|
-
|
66
|
-
|
67
|
-
or
|
68
|
-
|
69
|
-
```sass
|
65
|
+
// or
|
70
66
|
$line-height-method: ratio;
|
71
67
|
```
|
72
68
|
|
@@ -74,7 +70,7 @@ If you are using ratio, you should set your base ratio as so. Ignore this one
|
|
74
70
|
if you are using rhythm.
|
75
71
|
|
76
72
|
```sass
|
77
|
-
$base-line-height-ratio: 1.
|
73
|
+
$base-line-height-ratio: 1.5
|
78
74
|
```
|
79
75
|
|
80
76
|
By default typey will create print friendly stylesheets by adding a print media
|
@@ -95,7 +91,7 @@ $font-size: (
|
|
95
91
|
xl: 32px,
|
96
92
|
l: 24px,
|
97
93
|
m: 16px,
|
98
|
-
s:
|
94
|
+
s: 12px,
|
99
95
|
);
|
100
96
|
```
|
101
97
|
|
@@ -203,7 +199,7 @@ li {
|
|
203
199
|
```
|
204
200
|
|
205
201
|
All of typey's mixins accept a px value instead of a multiple/ratio or key from
|
206
|
-
the font-size map.
|
202
|
+
the $font-size map.
|
207
203
|
|
208
204
|
## Really quite tricky stuff (em as the $base-unit)
|
209
205
|
|
@@ -11,7 +11,7 @@ $base-font-size: 16px !default;
|
|
11
11
|
|
12
12
|
// The base line height will be used for most calculations involving height.
|
13
13
|
// Allowed units: px
|
14
|
-
$base-line-height:
|
14
|
+
$base-line-height: 24px !default;
|
15
15
|
|
16
16
|
// The method to calculate line-height. Allowed values: rhythm or ratio.
|
17
17
|
// Rhytm uses a vertical rhythm approach where line-height is specified as
|
@@ -21,7 +21,7 @@ $base-line-height: 20px !default;
|
|
21
21
|
$line-height-method: rhythm !default;
|
22
22
|
|
23
23
|
// The default ratio of line-height to font-size.
|
24
|
-
$base-line-height-ratio: 1.
|
24
|
+
$base-line-height-ratio: 1.5 !default;
|
25
25
|
|
26
26
|
// By default we will provide fallbacks when rem is the base unit.
|
27
27
|
$rem-fallback: true !default;
|
@@ -12,10 +12,10 @@
|
|
12
12
|
$type: typey-validator($context, $allowed-types);
|
13
13
|
@if $type == "font-size" {
|
14
14
|
$context-map-size: map-get($font-size, $context);
|
15
|
-
@return typey-output-in-
|
15
|
+
@return typey-output-in-unit(($x / $context-map-size), em);
|
16
16
|
}
|
17
17
|
@if $type == "px" {
|
18
|
-
@return typey-output-in-
|
18
|
+
@return typey-output-in-unit(($x / $context), em);
|
19
19
|
}
|
20
20
|
}
|
21
21
|
|
@@ -33,9 +33,9 @@
|
|
33
33
|
$type: typey-validator($context, $allowed-types);
|
34
34
|
@if $type == "font-size" {
|
35
35
|
$context-map-size: map-get($font-size, $context);
|
36
|
-
@return typey-output-in-
|
36
|
+
@return typey-output-in-unit(($x * $base-line-height) / $context-map-size, em);
|
37
37
|
}
|
38
38
|
@if $type == "px" {
|
39
|
-
@return typey-output-in-
|
39
|
+
@return typey-output-in-unit(($x * $base-line-height) / $context, em);
|
40
40
|
}
|
41
41
|
}
|
@@ -17,6 +17,27 @@
|
|
17
17
|
}
|
18
18
|
}
|
19
19
|
|
20
|
+
// Output a number in a chosen unit.
|
21
|
+
//
|
22
|
+
// @param number $number
|
23
|
+
// The number (without unit) to output.
|
24
|
+
// @param string $unit
|
25
|
+
// (optional) The unit to output, either em, px or rem.
|
26
|
+
//
|
27
|
+
// @return number
|
28
|
+
// The number with the base unit
|
29
|
+
@function typey-output-in-unit($number, $unit: $base-unit) {
|
30
|
+
@if $unit == rem {
|
31
|
+
@return $number * 1rem;
|
32
|
+
}
|
33
|
+
@if $unit == px {
|
34
|
+
@return $number * 1px;
|
35
|
+
}
|
36
|
+
@if $unit == em {
|
37
|
+
@return $number * 1em;
|
38
|
+
}
|
39
|
+
}
|
40
|
+
|
20
41
|
// Remove the unit from a number.
|
21
42
|
//
|
22
43
|
// @param number $number
|
@@ -22,13 +22,9 @@
|
|
22
22
|
line-height: $line-height;
|
23
23
|
}
|
24
24
|
@else {
|
25
|
-
@if $base-unit == rem {
|
26
|
-
@if $rem-fallback == true {
|
27
|
-
line-height: $line-height;
|
28
|
-
}
|
29
|
-
}
|
30
25
|
@if $base-unit == rem or $base-unit == em {
|
31
|
-
|
26
|
+
// In the html element, rem means relative to browser default font size; em means relative to html's font size.
|
27
|
+
line-height: calculate-em-px($line-height, $size);
|
32
28
|
}
|
33
29
|
@if $base-unit == px {
|
34
30
|
line-height: $line-height;
|
data/typey.gemspec
CHANGED
@@ -3,13 +3,13 @@
|
|
3
3
|
Gem::Specification.new do |spec|
|
4
4
|
spec.name = 'typey'
|
5
5
|
|
6
|
-
spec.summary = %q{A complete framework for working with typography
|
6
|
+
spec.summary = %q{A complete framework for working with typography in sass.}
|
7
7
|
|
8
8
|
spec.homepage = 'http://github.com/jptaranto/typey'
|
9
9
|
spec.rubyforge_project =
|
10
10
|
|
11
|
-
spec.version = '1.0.0.beta.
|
12
|
-
spec.date = '2015-
|
11
|
+
spec.version = '1.0.0.beta.8'
|
12
|
+
spec.date = '2015-09-04'
|
13
13
|
spec.licenses = ['GPL-2']
|
14
14
|
|
15
15
|
spec.authors = ['Jack Taranto']
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
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.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jack Taranto
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-09-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sass
|
@@ -71,9 +71,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
71
71
|
- !ruby/object:Gem::Version
|
72
72
|
version: 1.3.1
|
73
73
|
requirements: []
|
74
|
-
rubyforge_project: 1.0.0.beta.
|
74
|
+
rubyforge_project: 1.0.0.beta.8
|
75
75
|
rubygems_version: 2.4.6
|
76
76
|
signing_key:
|
77
77
|
specification_version: 4
|
78
|
-
summary: A complete framework for working with typography
|
78
|
+
summary: A complete framework for working with typography in sass.
|
79
79
|
test_files: []
|