4.1.1 • Published 6 years ago

@getbase/typography v4.1.1

Weekly downloads
5
License
MIT
Repository
github
Last release
6 years ago

Base Typography

Base Typography is designed in a way where you can add it on top of the Base CSS framework or to your own custom project.

Travis Build Status David Dependencies Status


Table of contents


Overview

Base Typography contains styles for headings, copy, blockquotes, codeblocks, lists and all other standard typography.


Installation

If you have an existing project and would like to include the Base typography module, run the following command:

npm install --save @getbase/typography

Once you have the typography module installed, you can include it in your CSS/LESS/SCSS file with one of the following ways:

CSS Import:

@import url("https://unpkg.com/@getbase/typography/index.css");

SCSS Import:

/* Import Base Typography */
@import "~@getbase/typography/scss/index";
/* Your Other Styles */
@import "main"

LESS Import:

/* Import Base Typography */
@import "~@getbase/typography/less/index";
/* Your Other Styles */
@import "main"

Documentation

Base Typography includes styles for headings (h1 - h6), heading helpers (.fs-1 - .fs-6), links, horizontal lines, and general typography.

Helpers (Applies to SCSS/LESS)

Helper ClassPurposeExampleOutcome
.fs-1Apply the same font size and line height as a h1<span class="fs-1">Heading</span>Applies h1 font size and line height to a span element
.fs-2Apply the same font size and line height as a h2<span class="fs-2">Heading</span>Applies h2 font size and line height to a span element
.fs-3Apply the same font size and line height as a h3<span class="fs-3">Heading</span>Applies h3 font size and line height to a span element
.fs-4Apply the same font size and line height as a h4<span class="fs-4">Heading</span>Applies h4 font size and line height to a span element
.fs-5Apply the same font size and line height as a h5<span class="fs-5">Heading</span>Applies h5 font size and line height to a span element
.fs-6Apply the same font size and line height as a h6<span class="fs-6">Heading</span>Applies h6 font size and line height to a span element

SCSS

Variables

VariablePurposeDefault
$base-background-colorColor applied to the background body#fff
$base-font-familyFont family applied to bodysans-serif
$base-font-sizeFont size applied to body16px
$base-line-heightLine height applied to body22px
$base-font-weightFont weight applied to body400
$base-font-colorFont color applied to body#000
$base-link-colorColor applied to links#000
$base-link-hover-colorColor applied to links on hover#000
$base-link-active-colorColor applied to links on active#000
$base-heading-font-familyFont family applied to headings h1 - h6sans-serif
$base-h1-font-sizeHeading 1 font size32px
$base-h1-line-heightHeading 1 line height38px
$base-h1-font-weightHeading 1 font weight700
$base-h1-colorHeading 1 color#000
$base-h2-font-sizeHeading 2 font size26px
$base-h2-line-heightHeading 2 line height32px
$base-h2-font-weightHeading 1 font weight700
$base-h2-colorHeading 2 color#000
$base-h3-font-sizeHeading 3 font size22px
$base-h3-line-heightHeading 3 line height28px
$base-h3-font-weightHeading 3 font weight700
$base-h3-colorHeading 3 color#000
$base-h4-font-sizeHeading 4 font size18px
$base-h4-line-heightHeading 4 line height24px
$base-h4-font-weightHeading 4 font weight700
$base-h4-colorHeading 4 color#000
$base-h5-font-sizeHeading 5 font size16px
$base-h5-line-heightHeading 5 line height22px
$base-h5-font-weightHeading 5 font weight700
$base-h5-colorHeading 5 color#000
$base-h6-font-sizeHeading 6 font size14px
$base-h6-line-heightHeading 6 line height20px
$base-h6-font-weightHeading 6 font weight700
$base-h6-colorHeading 6 color#000
$base-blockquote-font-familyFont family applied to blockquotessans-serif
$base-blockquote-font-sizeFont size applied to blockquotes18px
$base-blockquote-line-heightLine height applied to blockquotes24px
$base-blockquote-line-heightLine height applied to blockquotes24px
$base-blockquote-font-weightFont weight applied to blockquotes400
$base-blockquote-cite-font-weightFont weight applied to a cite within a blockquote700
$base-code-font-familyFont family applied to code blocksmonospace
$base-code-font-sizeFont size applied to code blocks13px
$base-code-line-heightLine height applied to code blocks18px
$base-code-colorFont color applied to code blocks#000
$base-code-background-colorBackground color applied to code blocks#f7f7f7
$base-code-border-colorBorder color applied to code blocks#e7e7e7

LESS

Variables

VariablePurposeDefault
@base-background-colorColor applied to the background body#fff
@base-font-familyFont family applied to bodysans-serif
@base-font-sizeFont size applied to body16px
@base-line-heightLine height applied to body22px
@base-font-weightFont weight applied to body400
@base-font-colorFont color applied to body#000
@base-link-colorColor applied to links#000
@base-link-hover-colorColor applied to links on hover#000
@base-link-active-colorColor applied to links on active#000
@base-heading-font-familyFont family applied to headings h1 - h6sans-serif
@base-h1-font-sizeHeading 1 font size32px
@base-h1-line-heightHeading 1 line height38px
@base-h1-font-weightHeading 1 font weight700
@base-h1-colorHeading 1 color#000
@base-h2-font-sizeHeading 2 font size26px
@base-h2-line-heightHeading 2 line height32px
@base-h2-font-weightHeading 1 font weight700
@base-h2-colorHeading 2 color#000
@base-h3-font-sizeHeading 3 font size22px
@base-h3-line-heightHeading 3 line height28px
@base-h3-font-weightHeading 3 font weight700
@base-h3-colorHeading 3 color#000
@base-h4-font-sizeHeading 4 font size18px
@base-h4-line-heightHeading 4 line height24px
@base-h4-font-weightHeading 4 font weight700
@base-h4-colorHeading 4 color#000
@base-h5-font-sizeHeading 5 font size16px
@base-h5-line-heightHeading 5 line height22px
@base-h5-font-weightHeading 5 font weight700
@base-h5-colorHeading 5 color#000
@base-h6-font-sizeHeading 6 font size14px
@base-h6-line-heightHeading 6 line height20px
@base-h6-font-weightHeading 6 font weight700
@base-h6-colorHeading 6 color#000
@base-blockquote-font-familyFont family applied to blockquotessans-serif
@base-blockquote-font-sizeFont size applied to blockquotes18px
@base-blockquote-line-heightLine height applied to blockquotes24px
@base-blockquote-font-weightFont weight applied to blockquotes400
@base-blockquote-cite-font-weightFont weight applied to a cite within a blockquote700
@base-code-font-familyFont family applied to code blocksmonospace
@base-code-font-sizeFont size applied to code blocks13px
@base-code-line-heightLine height applied to code blocks18px
@base-code-colorFont color applied to code blocks#000
@base-code-background-colorBackground color applied to code blocks#f7f7f7
@base-code-border-colorBorder color applied to code blocks#e7e7e7

Demo

View page example with the typography stylesheet applied.


Support

  • IE10+ and all other modern browsers.
  • Please specify browsers you need to support in package.json according to browserslist docs.

Authors

Matthew Hartman


License

Code released under the MIT Open Source license.

4.1.1

6 years ago

4.1.0

7 years ago

4.0.2

7 years ago

4.0.1

7 years ago

4.0.0

7 years ago

4.0.1-dev

7 years ago

4.0.0-dev

7 years ago