All Projects β†’ ianrose β†’ Typesettings

ianrose / Typesettings

Licence: mit
A Sass or Stylus toolkit that sets type in Ems based on modular scale, vertical rhythm, and responsive ratio based headlines.

Programming Languages

stylus
462 projects

Projects that are alternatives of or similar to Typesettings

Sing App
πŸ’₯Free and open-source admin dashboard template built with Bootstrap 4.5 πŸ’₯
Stars: ✭ 1,187 (+212.37%)
Mutual labels:  typography, scss, sass
Vertical Rhythm
Put some typographical vertical rhythm in your CSS. LESS, Stylus and SCSS/SASS versions included.
Stars: ✭ 83 (-78.16%)
Mutual labels:  typography, scss, sass
Light Blue Dashboard
πŸ”₯ Free and open-source admin dashboard template built with Bootstrap
Stars: ✭ 110 (-71.05%)
Mutual labels:  typography, scss, sass
Almace Scaffolding
AMSF, a.k.a. Almace Scaffolding, a super-fast Jekyll framework fighting against the website obesity.
Stars: ✭ 275 (-27.63%)
Mutual labels:  scss, sass
Sass Deprecate
Let Sass warn you about the pieces of your UI that are deprecated, providing a clear upgrade path for developers
Stars: ✭ 265 (-30.26%)
Mutual labels:  scss, sass
Input Range Scss
Styling Cross-Browser Compatible Range Inputs with Sass
Stars: ✭ 272 (-28.42%)
Mutual labels:  scss, sass
Vscode Stylelint
A Visual Studio Code extension to lint CSS/SCSS/Less with stylelint
Stars: ✭ 260 (-31.58%)
Mutual labels:  scss, sass
Scssphp
SCSS compiler written in PHP
Stars: ✭ 309 (-18.68%)
Mutual labels:  scss, sass
Styled Components Theme
Defines themes via flexible color selectors for use with styled-components
Stars: ✭ 302 (-20.53%)
Mutual labels:  scss, sass
Simple Typography
A simple starting ground for beautiful typography on the web using Sass.
Stars: ✭ 311 (-18.16%)
Mutual labels:  typography, sass
Pug Starter
Simple pug (jade) starter [framework] enabling faster delivery of HTML & CSS projects to a private server and/or automatic deployment of GitHub pages.
Stars: ✭ 328 (-13.68%)
Mutual labels:  scss, sass
Bulma Helpers
Library with missing Functional / Atomic CSS classes for Bulma framework
Stars: ✭ 263 (-30.79%)
Mutual labels:  scss, sass
Stylesheet
The GTK Stylesheet for elementary OS
Stars: ✭ 260 (-31.58%)
Mutual labels:  scss, sass
Juice
Mixins for Life
Stars: ✭ 274 (-27.89%)
Mutual labels:  scss, sass
Css
Believe in Better CSS
Stars: ✭ 262 (-31.05%)
Mutual labels:  scss, sass
Oruga
πŸ› Oruga is a lightweight library of UI components without CSS framework dependency
Stars: ✭ 297 (-21.84%)
Mutual labels:  scss, sass
Centurion
Centurion is a web-based framework for rapid prototyping and building larger web projects.
Stars: ✭ 327 (-13.95%)
Mutual labels:  typography, scss
Magento2 Theme Blank Sass
SASS based version of Magento 2 Blank theme
Stars: ✭ 373 (-1.84%)
Mutual labels:  scss, sass
Sass Loader
Compiles Sass to CSS
Stars: ✭ 3,718 (+878.42%)
Mutual labels:  scss, sass
baseline
New method for creating leading on the web
Stars: ✭ 31 (-91.84%)
Mutual labels:  typography, baseline

npm GitHub release GitHub license Gitter

Typesettings

Set your type in Ems with modular scale, vertical rhythm, and responsive ratio based headlines using Sass. Why create another type toolkit in Sass? I wanted to and I couldn't find exactly what I was looking for. Typesettings uses techniques from many different amazing tools while trying to keep it simple.

  • Its only dependency is Sass
  • It uses Ems not REMs or pixels
  • Handles all the math for Ems including the compounding
  • It maintains vertical rhythm with pixel based borders using padding set in Ems
  • It comes with a default 6px baseline to maintain rhythm on all block elements
  • It relies more on using Sass functions combined with vanilla CSS rules rather than mixins to style
  • It uses modular scale values to set font-size
  • It has optional default type styles that includes settings for adjusting headlines based on screen width

How to setup

There are four ways you can download Typesettings.

  • Download the latest release
  • Clone the repo: git clone https://github.com/ianrose/typesettings.git
  • Install with Bower: bower install typesettings --save
  • Install with npm: npm install typesettings --save

To start using Typesettings @import the _typesettings.scss partial into your Sass project after your CSS reset.

There is also the bundled single file versions. For example, using Typesettings on Codepen or you are looking to simply copy and paste Typesettings into your project. You can also start by @import the _typsettings.bundle.scss into your Sass project after your CSS reset.

 @import "path/your-reset";

 // Your settings for Typesettings :)
 $font-sans: 'Helvetica Neue', Helvetica, Arial, sans-serif;
 $font-serif: Georgia, 'Times New Roman', serif;
 $font-mono: 'Lucida Console', Monaco, monospace;
 $text-color: #000;
 $base-vertical-unit: 6px;
 $base-line-multi: 4;
 $base-font-size: 16px;
 $ms-ratio: 1.414;
 $paragraph-indent: true;
 $paragraph-justify: true;
 $load-typesetted: true;
 $global-init: false; // By default set to false, loaded with typesetted

 @import "path/typesettings"; // Here is the _typesettings.scss partial

 @import "path/your-styles";

Advanced Usage

You have the ability to easily import Typesettings' mixins, functions, and internal variables separately and use them how you see fit within your project. For example:

 @import "path/your-reset";

 // Your settings for Typesettings :)
 $font-sans: 'Helvetica Neue', Helvetica, Arial, sans-serif;
 $font-serif: Georgia, 'Times New Roman', serif;
 $font-mono: 'Lucida Console', Monaco, monospace;
 $text-color: #000;
 $base-vertical-unit: 6px;
 $base-line-multi: 4;
 $base-font-size: 16px;
 $ms-ratio: 1.414;

 // Import only the functionality of Typesettings you want
 @import "path/typesettings/settings";
 @import "path/typesettings/internal";
 @import "path/typesettings/functions";
 @import "path/typesettings/mixins";

 @include typesettingsInit();

 @import "path/your-styles";

How to use

After Typesettings is setup in your project the default type styles should be looking good. However I bet you want to use modular scale and vertical rhythm in the rest of your project. Here is an example of how to do that:

The Scss:

// This example is using Typesettings' default settings
// [1] 3 times the baseline grid value for margin-bottom.
// The second argument is the context font-size. In this case it is 1 step down in
// the modular scale.
//
// [2] Using an optional mixin, a 2px border bottom is set with padding bottom
// set to 3 times the baseline grid with 2px subtracted. By subtracting the 2px from
// the padding bottom, vertical rhythm is maintained.
//
// [3] Using an optional mixin, the line-height is set to 3 * baseline grid. Then
// the font-size is passed using our modular scale value.
.your-module {
   margin-bottom: emRhythm(3, $ms-down1); // [1]
   border-color: #000;
   border-style: solid;
   @include rhythmBorderBottom(2px, 3, $ms-down1); // [2]
   @include setType(3, $ms-down1); // [3]
}

The outputted CSS:

.your-module {
    margin-bottom: 1.59075em; /* 18px */
    border-color: #000;
    border-style: solid;
    border-bottom-width: 2px;
    padding-bottom: 1.414em; /* 16px */
    font-size: 0.70721em;
    line-height: 1.59075; /* 18px (Okay, not pixel perfect, 17.9999999999px) */
}

You can also look at the source code of the document site to see how it was made using Typesettings.

Requirements

Sass or Stylus, that's it.

Precision

Typesettings uses relative units and many of the values outputted are a result of dividing and multiplying. So a computed pixel value like 17.999999px will sometimes happen.

Thanks and Resources

Please ask questions on Gitter and use GitHub issues for bugs.

License

The MIT License (MIT)

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].