Skip to content

Commit

Permalink
Add $line-height-ratio
Browse files Browse the repository at this point in the history
  • Loading branch information
Cory Simmons committed Mar 23, 2015
1 parent 31159ce commit f3e9c0c
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 34 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ It's as easy as setting a few variables in [typographic.styl](typographic.styl)
## Settings
```stylus
$ratio = $golden
$line-height-ratio = $golden
$body-font = $helvetica
$body-font-weight = 300
$body-color = #666
Expand Down Expand Up @@ -106,5 +107,6 @@ $palatino = Palatino, 'Palatino Linotype', 'Palatino LT STD', "Book Antiqua
- [calc-polyfill](https://github.com/closingtag/calc-polyfill)
- [vminpoly](https://github.com/saabi/vminpoly)


### Credit
[Mike Riethmuller](http://twitter.com/MikeRiethmuller) came up with the idea of using `calc` with `vw` to create scaling typography [here](http://madebymike.com.au/writing/precise-control-responsive-typography/).
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "typographic",
"version": "2.0.2",
"version": "2.0.3",
"homepage": "https://github.com/corysimmons/typographic",
"authors": [
"Cory Simmons <cory@launchboxhq.com>"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"name": "Cory Simmons"
},
"main": "typographic.js",
"version": "2.0.2",
"version": "2.0.3",
"description": "Responsive typography with modular scale, font stacks, and more.",
"keywords": [
"stylus",
Expand Down
33 changes: 17 additions & 16 deletions typographic.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Typographic v2.0.2 - https://github.com/corysimmons/typographic
// Typographic v2.0.3 - https://github.com/corysimmons/typographic


// Ratios
Expand Down Expand Up @@ -59,6 +59,7 @@ $palatino : Palatino, 'Palatino Linotype', 'Palatino LT STD', "Book Antiqua
// Settings

$ratio : $golden;
$line-height-ratio : $golden;
$body-font : $helvetica;
$body-font-weight : 300;
$body-color : #666;
Expand All @@ -85,7 +86,7 @@ html {
$min-font: $min-font + $ratio;
$max-font: $max-font + $ratio;

line-height: #{$golden}em;
line-height: #{$line-height-ratio}em;

font-family: $body-font;
font-weight: $body-font-weight;
Expand Down Expand Up @@ -123,14 +124,14 @@ a, code,
dl, ol, ul,
form,
table {
margin-bottom: #{$golden}em;
margin-bottom: #{$line-height-ratio}em;
}

h1, h2, h3, h4, h5, h6 {
font-family: $header-font;
font-weight: $header-font-weight;
line-height: ($golden / 1.5) + em;
margin-bottom: ($golden * .25) + em;
line-height: ($line-height-ratio / 1.5) + em;
margin-bottom: ($line-height-ratio * .25) + em;
color: $header-color;
}

Expand Down Expand Up @@ -226,7 +227,7 @@ h6 {

blockquote {
font-style: italic;
padding-left: #{$golden}em;
padding-left: #{$line-height-ratio}em;
border-left: 5px solid darken(white, 7%);
cite {
display: block;
Expand All @@ -235,7 +236,7 @@ blockquote {
}

pre {
padding: ($golden * .25) + em;
padding: ($line-height-ratio * .25) + em;
background: darken(white, 2%);
border: 1px solid darken(white, 7%);
code {
Expand All @@ -247,7 +248,7 @@ pre {

code {
font-family: $courier;
padding: ($golden * .05) + em ($golden * .15) + em;
padding: ($line-height-ratio * .05) + em ($line-height-ratio * .15) + em;
background: darken(white, 2%);
border: 1px solid darken(white, 7%);
}
Expand All @@ -267,25 +268,25 @@ dt {
}

dd {
margin-bottom: ($golden * .25) + em;
margin-bottom: ($line-height-ratio * .25) + em;
}

ul {
padding-left: 1.1em;
li {
margin-bottom: ($golden * .25) + em;
margin-bottom: ($line-height-ratio * .25) + em;
}
}

ol {
padding-left: 1.4em;
li {
margin-bottom: ($golden * .25) + em;
margin-bottom: ($line-height-ratio * .25) + em;
}
}

fieldset {
padding: ($golden * .5) + em;
padding: ($line-height-ratio * .5) + em;
border: 1px solid darken(white, 7%);
}

Expand All @@ -296,11 +297,11 @@ legend {

label {
display: block;
margin-bottom: ($golden * .5) + em;
margin-bottom: ($line-height-ratio * .5) + em;
}

input[type="text"], textarea {
padding: ($golden * .5) + em;
padding: ($line-height-ratio * .5) + em;
border: 1px solid darken(white, 7%);
}

Expand All @@ -311,7 +312,7 @@ table {
}

th {
padding: ($golden * .5) + em;
padding: ($line-height-ratio * .5) + em;
text-align: left;
color: $header-color;
border: 1px solid darken(white, 7%);
Expand All @@ -326,6 +327,6 @@ tr {
}

td {
padding: ($golden * .5) + em;
padding: ($line-height-ratio * .5) + em;
border: 1px solid darken(white, 7%);
}
33 changes: 17 additions & 16 deletions typographic.styl
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
// Typographic v2.0.2 - https://github.com/corysimmons/typographic
// Typographic v2.0.3 - https://github.com/corysimmons/typographic


// Settings

$ratio = $golden
$line-height-ratio = $golden
$body-font = $helvetica
$body-font-weight = 300
$body-color = #666
Expand Down Expand Up @@ -78,7 +79,7 @@ html
$min-font = $min-font + $ratio
$max-font = $max-font + $ratio

line-height: ($golden)em
line-height: ($line-height-ratio)em

font-family: $body-font
font-weight: $body-font-weight
Expand Down Expand Up @@ -112,13 +113,13 @@ a, code,
dl, ol, ul,
form,
table
margin-bottom: ($golden)em
margin-bottom: ($line-height-ratio)em

h1, h2, h3, h4, h5, h6
font-family: $header-font
font-weight: $header-font-weight
line-height: ($golden / 1.5)em
margin-bottom: ($golden * .25)em
line-height: ($line-height-ratio / 1.5)em
margin-bottom: ($line-height-ratio * .25)em
color: $header-color

h1
Expand Down Expand Up @@ -195,14 +196,14 @@ h6

blockquote
font-style: italic
padding-left: ($golden)em
padding-left: ($line-height-ratio)em
border-left: 5px solid darken(white, 7%)
cite
display: block
font-style: normal

pre
padding: ($golden * .25)em
padding: ($line-height-ratio * .25)em
background: darken(white, 2%)
border: 1px solid darken(white, 7%)
code
Expand All @@ -212,7 +213,7 @@ pre

code
font-family: $courier
padding: ($golden * .05)em ($golden * .15)em
padding: ($line-height-ratio * .05)em ($line-height-ratio * .15)em
background: darken(white, 2%)
border: 1px solid darken(white, 7%)

Expand All @@ -228,20 +229,20 @@ dt
font-weight: bold

dd
margin-bottom: ($golden * .25)em
margin-bottom: ($line-height-ratio * .25)em

ul
padding-left: 1.1em
li
margin-bottom: ($golden * .25)em
margin-bottom: ($line-height-ratio * .25)em

ol
padding-left: 1.4em
li
margin-bottom: ($golden * .25)em
margin-bottom: ($line-height-ratio * .25)em

fieldset
padding: ($golden * .5)em
padding: ($line-height-ratio * .5)em
border: 1px solid darken(white, 7%)

legend
Expand All @@ -250,10 +251,10 @@ legend

label
display: block
margin-bottom: ($golden * .5)em
margin-bottom: ($line-height-ratio * .5)em

input[type="text"], textarea
padding: ($golden * .5)em
padding: ($line-height-ratio * .5)em
border: 1px solid darken(white, 7%)

table
Expand All @@ -262,7 +263,7 @@ table
border-collapse: collapse

th
padding: ($golden * .5)em
padding: ($line-height-ratio * .5)em
text-align: left
color: $header-color
border: 1px solid darken(white, 7%)
Expand All @@ -273,5 +274,5 @@ tr
background: darken(white, 3%)

td
padding: ($golden * .5)em
padding: ($line-height-ratio * .5)em
border: 1px solid darken(white, 7%)

0 comments on commit f3e9c0c

Please sign in to comment.