4.1.0 • Published 6 years ago

@getbase/typography-helpers v4.1.0

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

Base Typography Helpers

Base Typography Helpers 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 Helpers contains styles for adjusting font weights, text transformations and aligning copy for all breakpoints.


Installation

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

npm install --save @getbase/typography-helpers

Once you have the typography helpers 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-helpers/index.css");

SCSS Import:

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

LESS Import:

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

Documentation

Base Typography Helpers includes styles for font weights (.font-100 - .font-900), text transformations (.uppercase, .lowercase, capitalize) and aligning copy for all breakpoints (.text-right, .text-right-m, etc)

Helpers (Applies to SCSS/LESS)

Helper ClassPurposeExampleOutcome
.font-100Apply a font weight of 100<h2 class="font-100">Heading</h2>Applies a font weight of 100 to a h2 element
.font-200Apply a font weight of 200<h2 class="font-200">Heading</h2>Applies a font weight of 200 to a h2 element
.font-300Apply a font weight of 300<h2 class="font-300">Heading</h2>Applies a font weight of 300 to a h2 element
.font-400Apply a font weight of 400<h2 class="font-400">Heading</h2>Applies a font weight of 400 to a h2 element
.font-500Apply a font weight of 500<h2 class="font-500">Heading</h2>Applies a font weight of 500 to a h2 element
.font-600Apply a font weight of 600<h2 class="font-600">Heading</h2>Applies a font weight of 600 to a h2 element
.font-700Apply a font weight of 700<h2 class="font-700">Heading</h2>Applies a font weight of 700 to a h2 element
.font-800Apply a font weight of 800<h2 class="font-800">Heading</h2>Applies a font weight of 800 to a h2 element
.font-900Apply a font weight of 900<h2 class="font-900">Heading</h2>Applies a font weight of 900 to a h2 element
.no-selectDisables selection<body class="no-select">...</body>Disabled user from selecting text on a web page
.uppercaseApply a text transformation of uppercase<h3 class="uppercase">Heading</h3>Applies a text transformation of uppercase to a h3 element
.lowercaseApply a text transformation of lowercase<h3 class="lowercase">Heading</h3>Applies a text transformation of lowercase to a h3 element
.capitalizeApply a text transformation of capitalize<h3 class="capitalize">Heading</h3>Applies a text transformation of capitalize to a h3 element
.text-leftApply a text alignment of left<div class="text-left">This text will be aligned to the left</div>Applies text alignment of left to a div element
.text-rightApply a text alignment of right<div class="text-right">This text will be aligned to the right</div>Applies text alignment of right to a div element
.text-centerApply a text alignment of center<div class="text-center">This text alignment will be centered</div>Applies text alignment of center to a div element
.text-left-mApply a text alignment of left for medium devices and above<div class="text-left-m">This text will be aligned to the left for medium devices and above</div>Applies text alignment of left to a div element for medium devices and above
.text-right-mApply a text alignment of right for medium devices and above<div class="text-right-m">This text will be aligned to the right for medium devices and above</div>Applies text alignment of right to a div element for medium devices and above
.text-center-mApply a text alignment of center for medium devices and above<div class="text-center-m">This text alignment will be centered for medium devices and above</div>Applies text alignment of center to a div element for medium devices and above
.text-left-lApply a text alignment of left for large devices and above<div class="text-left-l">This text will be aligned to the left for large devices and above</div>Applies text alignment of left to a div element for large devices and above
.text-right-lApply a text alignment of right for large devices and above<div class="text-right-l">This text will be aligned to the right for large devices and above</div>Applies text alignment of right to a div element for large devices and above
.text-center-lApply a text alignment of center for large devices and above<div class="text-center-l">This text alignment will be centered for large devices and above</div>Applies text alignment of center to a div element for large devices and above
.text-left-xlApply a text alignment of left for extra large devices and above<div class="text-left-xl">This text will be aligned to the left for extra large devices and above</div>Applies text alignment of left to a div element for extra large devices and above
.text-right-xlApply a text alignment of right for extra large devices and above<div class="text-right-xl">This text will be aligned to the right for extra large devices and above</div>Applies text alignment of right to a div element for extra large devices and above
.text-center-xlApply a text alignment of center for extra large devices and above<div class="text-center-xl">This text alignment will be centered for extra large devices and above</div>Applies text alignment of center to a div element for extra large devices and above

Demo

View page example with the typography helpers 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.