Skip to content

Set text on the web to a baseline grid with Sass & rems.

Notifications You must be signed in to change notification settings

johnellison/sassline

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

59 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Set text on the web to a baseline grid with Sass & rems.

New in v2.1

Layouts added with new mixins to create a main column with optimal measure and a sidebar that doesn’t get too narrow. Better baseline grid overlay.

Do one thing well

There are many different options when it comes to boilerplates, frameworks and pattern libraries these days. Sassline has one aim and one aim only – to spread better typography across the responsive environment that is the web.

The idea is to have easy to use and maintain SCSS files utilising the power of Sass to make the complex calculations to set type on a baseline grid on the web, with a production ready CSS output. Using rems for the font-sizing and the spacing measurements gives a simple way to use the proportions of the baseline grid throughout the design. Sass mixins do all the heavy lifting so your job is easy.

OpenType features are enabled to give the nicest formatting of text and some flourishes in the headings if available in the web font and supported in the browser.

Root font-size = ½ line-height

Sassline is based on setting the root font-size as half the line-height of the paragraph text. The height of the baseline grid is then effectively set at 2rem, with increments at each 1rem. This makes it nice and easy to work proportionally from the baseline with integer rem values.

Smaller web fonts for mobiles

Getting the most out of OpenType features can end up with large typeface files being served to your site as discussed on the Typekit blog. Included in Sassline is a method for using a smaller kit (without the full character sets) at smaller viewport sizes where OpenType support is low anyway to save downloading the extra characters.

Documentation

Sassline is fully commented with details in the SCSS. Set the font sizes with the font-size mixin, set the spacing using the baseline mixin or set both at once with the sassline mixin. Use rems for everything else. Here are some other key points:

Compiling Sass

Using Sass 3.3.7+ and Sass-Globbing:

sass -r sass-globbing --watch assets/sass:assets/css

Alternatively a Mixture simple project settings file is included which will compile the Sass + minify for you (as well as much more). Sassline is also available as a mixture boilerplate here.

You can also used your preferred methods for compiling sass as long as you have Sass 3.3.7+ and Sass-Globbing enabled.

Sass file structure

My preferred method is to work along the lines of the SMACSS & BEM method. In the sass folder there there are two folders — base and modules. The base folder has the Sassline base SCSS partials. The modules folder contains some demo SCSS partials with styles you can keep or remove. All new partials added to modules will be compiled into your css so work in here with new files.

Using Sassline

Please see this blog post.

Responsive Nav

Viljami Salminen’s responsive-nav.js plugin is included to provide a mobile ready navigation to work from.

Browsers

Browsers will be browsers. Sassline will set text to the baseline in recent versions of Chrome and Firefox, IE 11+ and Safari 8+. It will not work currently in Safari 7 or Safari on iOS 7 as they do not support subpixel padding.

Roadmap

  • Full documentation

========

License

The MIT License (MIT)

Copyright (c) 2013-2014 Jake Giltsoff

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

Set text on the web to a baseline grid with Sass & rems.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • CSS 68.5%
  • JavaScript 16.0%
  • HTML 15.4%
  • Ruby 0.1%