From 2bc0f29de304fab0af06704d40b94514db74432f Mon Sep 17 00:00:00 2001 From: Eric Ferraiuolo Date: Thu, 22 Aug 2013 16:48:38 -0400 Subject: [PATCH] Specify font stacks for grids and grid units By setting _specific_ font stacks grids, it can be assured that the letter and word spacing will be applied correctly. The font stack for grid units is then set back to `sans-serif`, which is also the default font stack that Normalize.css applied to the `body`. Closes #41 --- src/grids/css/grids-core.css | 16 ++++++++++++++++ src/grids/css/grids-r.css | 14 ++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/src/grids/css/grids-core.css b/src/grids/css/grids-core.css index 5b8cb8c..bd13322 100644 --- a/src/grids/css/grids-core.css +++ b/src/grids/css/grids-core.css @@ -1,8 +1,16 @@ +/*csslint regex-selectors:false*/ + .pure-g { letter-spacing: -0.31em; /* Webkit: collapse white-space between units */ *letter-spacing: normal; /* reset IE < 8 */ *word-spacing: -0.43em; /* IE < 8: collapse white-space between units */ text-rendering: optimizespeed; /* Webkit: fixes text-rendering: optimizeLegibility */ + + /* + Sets the font stack to fonts known to work properly with the above + letter and word spacings. + */ + font-family: Helvetica, Arial, "DejaVu Sans", sans-serif; } /* Opera as of 12 on Windows needs word-spacing. @@ -23,3 +31,11 @@ vertical-align: top; text-rendering: auto; } + +/* +Resets the font family back to the OS/browser's default sans-serif font, +this the same font stack that Normalize.css sets for the `body`. +*/ +.pure-g [class *= "pure-u"] { + font-family: sans-serif; +} diff --git a/src/grids/css/grids-r.css b/src/grids/css/grids-r.css index abccefd..17ff54b 100644 --- a/src/grids/css/grids-r.css +++ b/src/grids/css/grids-r.css @@ -4,6 +4,12 @@ letter-spacing: -0.31em; *letter-spacing: normal; *word-spacing: -0.43em; + + /* + Sets the font stack to fonts known to work properly with the above + letter and word spacings. + */ + font-family: Helvetica, Arial, "DejaVu Sans", sans-serif; } /* Opera as of 12 on Windows needs word-spacing. @@ -15,6 +21,14 @@ word-spacing: -0.43em; } +/* +Resets the font family back to the OS/browser's default sans-serif font, +this the same font stack that Normalize.css sets for the `body`. +*/ +.pure-g-r [class *= "pure-u"] { + font-family: sans-serif; +} + .pure-g-r img { max-width: 100%; }