font-stacks 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.mdown CHANGED
@@ -1,3 +1,16 @@
1
+ # 0.1.3
2
+
3
+ * [NEW] Added $default-monospace var to override the default monospace.
4
+ * [NEW] Added support for the font-family() `@mixin` as well as its shortened counterpart ff().
5
+ * [NEW] Added $default-font-family var. Defaults to "Helvetica".
6
+ * [CHANGED] Updated the @else in both the function/mixin to return using $default-font-family.
7
+ * [CHANGED] Since we now have a function and a mixin, they are their own partials now. @import and usage remains the same.
8
+ * [FIXED] Updated the Baskerville old face to Baskerville Old Face.
9
+
1
10
  # 0.1.0 - 0.1.2
2
11
 
3
- * Initial version ready for development and testing (likely to be solid enough for 1.0.0)
12
+ * Initial version ready for development and testing (likely to be solid enough for 1.0.0)
13
+
14
+ ---
15
+
16
+ Keys: [NEW] [CHANGED] [FIXED]
data/lib/font-stacks.rb CHANGED
@@ -3,7 +3,7 @@ Compass::Frameworks.register("font-stacks", :path => "#{File.dirname(__FILE__)}/
3
3
 
4
4
  module FontStacks
5
5
 
6
- VERSION = "0.1.2"
7
- DATE = "2011-11-22"
6
+ VERSION = "0.1.3"
7
+ DATE = "2011-11-23"
8
8
 
9
9
  end
@@ -12,159 +12,10 @@
12
12
  // Avoid using Helvetica or Helvetica Neue for body text, especially below 14px.
13
13
  // Futura, Gill Sans and Franklin Gothic Medium should be carefully stacked and used because of their unusual weight.
14
14
 
15
- @function font-family($family) {
16
-
17
- //
18
- // Serif
19
- //
15
+ $default-font-family: "Helvetica" !default;
16
+ $default-monospace: false !default;
17
+ $family: $default-font-family !default;
20
18
 
21
- // BASKERVILLE ( 88.60% on Mac, 49.10% on Windows)
22
- @if $family == "Baskerville" {
23
- @return Baskerville, "Baskerville old face", "Hoefler Text", Garamond, "Times New Roman", serif;
24
- }
19
+ @import "font-stacks/function";
20
+ @import "font-stacks/mixin";
25
21
 
26
- // BIG CASLON (85.10% on Mac)
27
- @else if $family == "Big Caslon" {
28
- @return "Big Caslon", "Book Antiqua", "Palatino Linotype", Georgia, serif;
29
- }
30
-
31
- // BODONI (47.89% on Windows)
32
- @else if $family == "Bodoni MT" {
33
- @return "Bodoni MT", Didot, "Didot LT STD", "Hoefler Text", Garamond, "Times New Roman", serif;
34
- }
35
-
36
- // BOOK ANTIQUA (86.09% on Mac)
37
- @else if $family == "Book Antiqua" {
38
- @return "Book Antiqua", Palatino, "Palatino Linotype", "Palatino LT STD", Georgia, serif;
39
- }
40
-
41
- // CAMBRIA (54.51% on Windows)
42
- @else if $family == "Cambria" {
43
- @return Cambria, Georgia, serif;
44
- }
45
-
46
- // CONSTANTIA (53.81% on Windows)
47
- @else if $family == "Constantia" {
48
- @return Constantia, Palatino, "Palatino Linotype", "Palatino LT STD", Georgia, serif;
49
- }
50
-
51
- // DIDOT (87.72% on Mac)
52
- @else if $family == "Didot" {
53
- @return Didot, "Didot LT STD", "Hoefler Text", Garamond, "Times New Roman", serif;
54
- }
55
-
56
- // GARAMOND (23.84% on Mac, 86.24% on Windows)
57
- @else if $family == "Garamond" {
58
- @return Garamond, Baskerville, "Baskerville Old Face", "Hoefler Text", "Times New Roman", serif;
59
- }
60
-
61
- // GOUDY OLD STYLE (51.30% on Windows)
62
- @else if $family == "Goudy Old Style" {
63
- @return "Goudy Old Style", Garamond, "Big Caslon", "Times New Roman", serif;
64
- }
65
-
66
- // HOEFLER TEXT (88.70% on Mac, 1.16% on Windows)
67
- @else if $family == "Hoefler Text" {
68
- @return "Hoefler Text", "Baskerville old face", Garamond, "Times New Roman", serif;
69
- }
70
-
71
- // LUCIDA BRIGHT (64.90% on Mac, 33.84% on Windows) - huge x-height
72
- @else if $family == "Lucida Bright" {
73
- @return "Lucida Bright", Georgia, serif;
74
- }
75
-
76
- // PALATINO (79.71% on Mac, 98.04% on Windows)
77
- @else if $family == "Palatino" {
78
- @return Palatino, "Palatino Linotype", "Palatino LT STD", "Book Antiqua", Georgia, serif;
79
- }
80
-
81
- //
82
- // Sans-serif
83
- //
84
-
85
- // CALIBRI (54.76% on Windows)
86
- @else if $family == "Calibri" {
87
- @return Calibri, Candara, Segoe, "Segoe UI", Optima, Arial, sans-serif;
88
- }
89
-
90
- // CANDARA (54.31% on Windows)
91
- @else if $family == "Candara" {
92
- @return Candara, Calibri, Segoe, "Segoe UI", Optima, Arial, sans-serif;
93
- }
94
-
95
- // FRANKLIN GOTHIC MEDIUM (97.89% on Windows)
96
- @else if $family == "Franklin Gothic Medium" {
97
- @return "Franklin Gothic Medium", Arial, sans-serif;
98
- }
99
-
100
- // FUTURA (91.01% on Mac)
101
- @else if $family == "Futura" {
102
- @return Futura, "Trebuchet MS", Arial, sans-serif;
103
- }
104
-
105
- // GENEVA (98.84% on Mac)
106
- @else if $family == "Geneva" {
107
- @return Geneva, Tahoma, Verdana, sans-serif;
108
- }
109
-
110
- // GILL SANS (91.52% on Mac, 51.74% on Windows)
111
- @else if $family == "Gill Sans" {
112
- @return "Gill Sans", "Gill Sans MT", Calibri, sans-serif;
113
- }
114
-
115
- // HELVETICA NEUE (94.74% on Mac)
116
- @else if $family == "Helvetica Neue" {
117
- @return "Helvetica Neue", Helvetica, Arial, 'Liberation Sans', FreeSans, sans-serif;
118
- }
119
- // Alias to "helvetica-neue"
120
- @else if $family == "Helvetica" { @return font-family("Helvetica Neue"); }
121
-
122
- // LUCIDA GRANDE (99.13% on Mac, 98.25% on Windows)
123
- @else if $family == "Lucida Grande" {
124
- @return "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", Geneva, Verdana, sans-serif;
125
- }
126
-
127
- // OPTIMA (90.14% on Mac)
128
- @else if $family == "Optima" {
129
- @return Optima, Segoe, "Segoe UI", Candara, Calibri, Arial, sans-serif;
130
- }
131
-
132
- // SEGOE (45.04% on Windows)
133
- @else if $family == "Segoe" {
134
- @return Segoe, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
135
- }
136
-
137
- // TAHOMA (99.30% on Windows)
138
- @else if $family == "Tahoma" {
139
- @return Tahoma, Geneva, Verdana, sans-serif;
140
- }
141
-
142
- // TREBUCHET (94.20% on Mac, 99% on Windows)
143
- @else if $family == "Trebuchet MS" {
144
- @return "Trebuchet MS", "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", Tahoma, sans-serif;
145
- }
146
-
147
- // VERDANA (96.81% on Mac, 99.40% on Windows)
148
- @else if $family == "Verdana" {
149
- @return Verdana, Geneva, sans-serif;
150
- }
151
-
152
- //
153
- // Monospace
154
- //
155
-
156
- @else if $family == "Monospace" {
157
- @return "DejaVu Sans Mono", Menlo, Monaco, Consolas, Courier, monospace;
158
- }
159
- // Alias to "Monospace"
160
- @else if $family == "monospace" { @return font-family("Monospace"); }
161
-
162
- @else {
163
- @return sans-serif;
164
- }
165
-
166
- }
167
-
168
- @function ff($family) {
169
- @return font-family($family);
170
- }
@@ -0,0 +1,171 @@
1
+ @function font-family($family) {
2
+
3
+ //
4
+ // Serif
5
+ //
6
+
7
+ // BASKERVILLE ( 88.60% on Mac, 49.10% on Windows)
8
+ @if $family == "Baskerville" {
9
+ @return Baskerville, "Baskerville Old Face", "Hoefler Text", Garamond, "Times New Roman", serif;
10
+ }
11
+
12
+ // BIG CASLON (85.10% on Mac)
13
+ @else if $family == "Big Caslon" {
14
+ @return "Big Caslon", "Book Antiqua", "Palatino Linotype", Georgia, serif;
15
+ }
16
+
17
+ // BODONI (47.89% on Windows)
18
+ @else if $family == "Bodoni MT" {
19
+ @return "Bodoni MT", Didot, "Didot LT STD", "Hoefler Text", Garamond, "Times New Roman", serif;
20
+ }
21
+
22
+ // BOOK ANTIQUA (86.09% on Mac)
23
+ @else if $family == "Book Antiqua" {
24
+ @return "Book Antiqua", Palatino, "Palatino Linotype", "Palatino LT STD", Georgia, serif;
25
+ }
26
+
27
+ // CAMBRIA (54.51% on Windows)
28
+ @else if $family == "Cambria" {
29
+ @return Cambria, Georgia, serif;
30
+ }
31
+
32
+ // CONSTANTIA (53.81% on Windows)
33
+ @else if $family == "Constantia" {
34
+ @return Constantia, Palatino, "Palatino Linotype", "Palatino LT STD", Georgia, serif;
35
+ }
36
+
37
+ // DIDOT (87.72% on Mac)
38
+ @else if $family == "Didot" {
39
+ @return Didot, "Didot LT STD", "Hoefler Text", Garamond, "Times New Roman", serif;
40
+ }
41
+
42
+ // GARAMOND (23.84% on Mac, 86.24% on Windows)
43
+ @else if $family == "Garamond" {
44
+ @return Garamond, Baskerville, "Baskerville Old Face", "Hoefler Text", "Times New Roman", serif;
45
+ }
46
+
47
+ // GOUDY OLD STYLE (51.30% on Windows)
48
+ @else if $family == "Goudy Old Style" {
49
+ @return "Goudy Old Style", Garamond, "Big Caslon", "Times New Roman", serif;
50
+ }
51
+
52
+ // HOEFLER TEXT (88.70% on Mac, 1.16% on Windows)
53
+ @else if $family == "Hoefler Text" {
54
+ @return "Hoefler Text", "Baskerville Old Face", Garamond, "Times New Roman", serif;
55
+ }
56
+
57
+ // LUCIDA BRIGHT (64.90% on Mac, 33.84% on Windows) - huge x-height
58
+ @else if $family == "Lucida Bright" {
59
+ @return "Lucida Bright", Georgia, serif;
60
+ }
61
+
62
+ // PALATINO (79.71% on Mac, 98.04% on Windows)
63
+ @else if $family == "Palatino" {
64
+ @return Palatino, "Palatino Linotype", "Palatino LT STD", "Book Antiqua", Georgia, serif;
65
+ }
66
+
67
+ //
68
+ // Sans-serif
69
+ //
70
+
71
+ // CALIBRI (54.76% on Windows)
72
+ @else if $family == "Calibri" {
73
+ @return Calibri, Candara, Segoe, "Segoe UI", Optima, Arial, sans-serif;
74
+ }
75
+
76
+ // CANDARA (54.31% on Windows)
77
+ @else if $family == "Candara" {
78
+ @return Candara, Calibri, Segoe, "Segoe UI", Optima, Arial, sans-serif;
79
+ }
80
+
81
+ // FRANKLIN GOTHIC MEDIUM (97.89% on Windows)
82
+ @else if $family == "Franklin Gothic Medium" {
83
+ @return "Franklin Gothic Medium", Arial, sans-serif;
84
+ }
85
+
86
+ // FUTURA (91.01% on Mac)
87
+ @else if $family == "Futura" {
88
+ @return Futura, "Trebuchet MS", Arial, sans-serif;
89
+ }
90
+
91
+ // GENEVA (98.84% on Mac)
92
+ @else if $family == "Geneva" {
93
+ @return Geneva, Tahoma, Verdana, sans-serif;
94
+ }
95
+
96
+ // GILL SANS (91.52% on Mac, 51.74% on Windows)
97
+ @else if $family == "Gill Sans" {
98
+ @return "Gill Sans", "Gill Sans MT", Calibri, sans-serif;
99
+ }
100
+
101
+ // HELVETICA NEUE (94.74% on Mac)
102
+ @else if $family == "Helvetica Neue" {
103
+ @return "Helvetica Neue", Helvetica, Arial, "Liberation Sans", FreeSans, sans-serif;
104
+ }
105
+ // Alias to "helvetica-neue"
106
+ @else if $family == "Helvetica" {
107
+ @return font-family("Helvetica Neue");
108
+ }
109
+
110
+ // LUCIDA GRANDE (99.13% on Mac, 98.25% on Windows)
111
+ @else if $family == "Lucida Grande" {
112
+ @return "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", Geneva, Verdana, sans-serif;
113
+ }
114
+
115
+ // OPTIMA (90.14% on Mac)
116
+ @else if $family == "Optima" {
117
+ @return Optima, Segoe, "Segoe UI", Candara, Calibri, Arial, sans-serif;
118
+ }
119
+
120
+ // SEGOE (45.04% on Windows)
121
+ @else if $family == "Segoe" {
122
+ @return Segoe, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
123
+ }
124
+
125
+ // TAHOMA (99.30% on Windows)
126
+ @else if $family == "Tahoma" {
127
+ @return Tahoma, Geneva, Verdana, sans-serif;
128
+ }
129
+
130
+ // TREBUCHET (94.20% on Mac, 99% on Windows)
131
+ @else if $family == "Trebuchet MS" {
132
+ @return "Trebuchet MS", "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", Tahoma, sans-serif;
133
+ }
134
+
135
+ // VERDANA (96.81% on Mac, 99.40% on Windows)
136
+ @else if $family == "Verdana" {
137
+ @return Verdana, Geneva, sans-serif;
138
+ }
139
+
140
+ //
141
+ // Monospace
142
+ //
143
+
144
+ @else if $family == "Monospace" {
145
+ @if $default-monospace {
146
+ @return $default-monospace;
147
+ }
148
+ @else {
149
+ @return "DejaVu Sans Mono", Menlo, Monaco, Consolas, Courier, monospace;
150
+ }
151
+ }
152
+
153
+ // Alias to "Monospace"
154
+ @else if $family == "monospace" {
155
+ @return font-family("Monospace");
156
+ }
157
+
158
+ //
159
+ // Else, catch all, fail safe
160
+ //
161
+
162
+ @else {
163
+ @return font-family($default-font-family);
164
+ }
165
+
166
+ }
167
+
168
+ // Shorthand counterpart
169
+ @function ff($family) {
170
+ @return font-family($family);
171
+ }
@@ -0,0 +1,167 @@
1
+ @mixin font-family($family) {
2
+
3
+ //
4
+ // Serif
5
+ //
6
+
7
+ // BASKERVILLE ( 88.60% on Mac, 49.10% on Windows)
8
+ @if $family == "Baskerville" {
9
+ font-family: font-family($family);
10
+ }
11
+
12
+ // BIG CASLON (85.10% on Mac)
13
+ @else if $family == "Big Caslon" {
14
+ font-family: font-family($family);
15
+ }
16
+
17
+ // BODONI (47.89% on Windows)
18
+ @else if $family == "Bodoni MT" {
19
+ font-family: font-family($family);
20
+ }
21
+
22
+ // BOOK ANTIQUA (86.09% on Mac)
23
+ @else if $family == "Book Antiqua" {
24
+ font-family: font-family($family);
25
+ }
26
+
27
+ // CAMBRIA (54.51% on Windows)
28
+ @else if $family == "Cambria" {
29
+ font-family: font-family($family);
30
+ }
31
+
32
+ // CONSTANTIA (53.81% on Windows)
33
+ @else if $family == "Constantia" {
34
+ font-family: font-family($family);
35
+ }
36
+
37
+ // DIDOT (87.72% on Mac)
38
+ @else if $family == "Didot" {
39
+ font-family: font-family($family);
40
+ }
41
+
42
+ // GARAMOND (23.84% on Mac, 86.24% on Windows)
43
+ @else if $family == "Garamond" {
44
+ font-family: font-family($family);
45
+ }
46
+
47
+ // GOUDY OLD STYLE (51.30% on Windows)
48
+ @else if $family == "Goudy Old Style" {
49
+ font-family: font-family($family);
50
+ }
51
+
52
+ // HOEFLER TEXT (88.70% on Mac, 1.16% on Windows)
53
+ @else if $family == "Hoefler Text" {
54
+ font-family: font-family($family);
55
+ }
56
+
57
+ // LUCIDA BRIGHT (64.90% on Mac, 33.84% on Windows) - huge x-height
58
+ @else if $family == "Lucida Bright" {
59
+ font-family: font-family($family);
60
+ }
61
+
62
+ // PALATINO (79.71% on Mac, 98.04% on Windows)
63
+ @else if $family == "Palatino" {
64
+ font-family: font-family($family);
65
+ }
66
+
67
+ //
68
+ // Sans-serif
69
+ //
70
+
71
+ // CALIBRI (54.76% on Windows)
72
+ @else if $family == "Calibri" {
73
+ font-family: font-family($family);
74
+ }
75
+
76
+ // CANDARA (54.31% on Windows)
77
+ @else if $family == "Candara" {
78
+ font-family: font-family($family);
79
+ }
80
+
81
+ // FRANKLIN GOTHIC MEDIUM (97.89% on Windows)
82
+ @else if $family == "Franklin Gothic Medium" {
83
+ font-family: font-family($family);
84
+ }
85
+
86
+ // FUTURA (91.01% on Mac)
87
+ @else if $family == "Futura" {
88
+ font-family: font-family($family);
89
+ }
90
+
91
+ // GENEVA (98.84% on Mac)
92
+ @else if $family == "Geneva" {
93
+ font-family: font-family($family);
94
+ }
95
+
96
+ // GILL SANS (91.52% on Mac, 51.74% on Windows)
97
+ @else if $family == "Gill Sans" {
98
+ font-family: font-family($family);
99
+ }
100
+
101
+ // HELVETICA NEUE (94.74% on Mac)
102
+ @else if $family == "Helvetica Neue" {
103
+ font-family: font-family($family);
104
+ }
105
+
106
+ // Alias to "Helvetica Neue"
107
+ @else if $family == "Helvetica" {
108
+ font-family: font-family("Helvetica Neue");
109
+ }
110
+
111
+ // LUCIDA GRANDE (99.13% on Mac, 98.25% on Windows)
112
+ @else if $family == "Lucida Grande" {
113
+ font-family: font-family($family);
114
+ }
115
+
116
+ // OPTIMA (90.14% on Mac)
117
+ @else if $family == "Optima" {
118
+ font-family: font-family($family);
119
+ }
120
+
121
+ // SEGOE (45.04% on Windows)
122
+ @else if $family == "Segoe" {
123
+ font-family: font-family($family);
124
+ }
125
+
126
+ // TAHOMA (99.30% on Windows)
127
+ @else if $family == "Tahoma" {
128
+ font-family: font-family($family);
129
+ }
130
+
131
+ // TREBUCHET (94.20% on Mac, 99% on Windows)
132
+ @else if $family == "Trebuchet MS" {
133
+ font-family: font-family($family);
134
+ }
135
+
136
+ // VERDANA (96.81% on Mac, 99.40% on Windows)
137
+ @else if $family == "Verdana" {
138
+ font-family: font-family($family);
139
+ }
140
+
141
+ //
142
+ // Monospace
143
+ //
144
+
145
+ @else if $family == "Monospace" {
146
+ font-family: font-family($family);
147
+ }
148
+
149
+ // Alias to "Monospace"
150
+ @else if $family == "monospace" {
151
+ font-family: font-family("Monospace");
152
+ }
153
+
154
+ //
155
+ // Else, catch all, fail safe
156
+ //
157
+
158
+ @else {
159
+ font-family: font-family($default-font-family);
160
+ }
161
+
162
+ }
163
+
164
+ // Shorthand counterpart
165
+ @mixin ff($family) {
166
+ @include font-family($family);
167
+ }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: font-stacks
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-11-22 00:00:00.000000000Z
12
+ date: 2011-11-23 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: compass
16
- requirement: &70122685443460 !ruby/object:Gem::Requirement
16
+ requirement: &70134073545220 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: 0.11.5
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70122685443460
24
+ version_requirements: *70134073545220
25
25
  description: Sass/Compass extension for Sassy access to common web-friendly font-stacks
26
26
  email:
27
27
  - adam@stacoviak.com
@@ -32,6 +32,8 @@ files:
32
32
  - CHANGELOG.mdown
33
33
  - lib/font-stacks.rb
34
34
  - stylesheets/_font-stacks.scss
35
+ - stylesheets/font-stacks/_function.scss
36
+ - stylesheets/font-stacks/_mixin.scss
35
37
  homepage: https://github.com/adamstac/font-stacks
36
38
  licenses: []
37
39
  post_install_message:
@@ -46,7 +48,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
46
48
  version: '0'
47
49
  segments:
48
50
  - 0
49
- hash: -1298239950921155142
51
+ hash: 2595218414718269859
50
52
  required_rubygems_version: !ruby/object:Gem::Requirement
51
53
  none: false
52
54
  requirements: