0.4.0 • Published 5 years ago

@torq-design/typography v0.4.0

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

Typography

Open Source Love npm version

This package defines a set of font profiles for Torq Design.

Demo in StackBlitz

Setup

Installation

Install the typography component in your project using npm.

npm i @torq-design/typography

Import Sass

Import the Sass file into your base styling file.

@import "@torq-design/typography/torq-typography";

Make sure your project's SASS compiler is configured to look in the node_modules directory.

Import CSS

We do offer a pre-compiled CSS version if your project doesn't use SCSS.

<link rel="stylesheet" href="../../node_modules/@torq-design/typography/css/torq-typography.css">

Or

@import "../../node_modules/@torq-design/typography/css/torq-typography.css";

Import Font

Import our default font (Roboto) in your root HTML file.

<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Roboto+Slab" rel="stylesheet">

Or, import the font in your base styling file.

@import url('https://fonts.googleapis.com/css?family=Roboto:300,400,500,700');
@import url('https://fonts.googleapis.com/css?family=Roboto+Slab');

If you need weights beyond those used in our font profiles, feel free to customize the import here. You can also add the italic variants for different weights if that's necessary.

Apply Base Font

Use our base css class to make Roboto the default font.

<body class="torq-typ">

Or, use the Sass mixin.

body {
  @include torq-typ-base;
}

Font Profiles

SCALE CATEGORYHTML TAGCSS CLASSUSAGEWEIGHTSIZE*TRACKING*LINE HEIGHT*TYPEFACE*
H1<h1>torq-typ--h1KPI'sAny50px073pxRoboto
H2<h2>torq-typ--h2KPI'sAny38px056pxRoboto
H3<h3>torq-typ--page-headerPage HeadersRegular24px035pxRoboto
H4<h4>torq-typ--section-headerCard HeaderBold20pxAuto29pxRoboto
H5<h5>torq-typ--title1Title 1Medium18pxAuto27pxRoboto
H6<h6>torq-typ--title2Title 2Bold15pxAuto26pxRoboto
Body 1<p>, <button>torq-typ--body1Body Copy & ButtonsMedium15pxAuto26pxRoboto
Body 2<span>, <p>, <div>torq-typ--body2Paragraph TextRegular15pxAuto26pxRoboto
Charts<table>, <th>torq-typ--chart-titleChart TitlesMedium13px0.13px15pxRoboto
Notes<p>, <span>, <div>torq-typ--small-textSmall textMedium13px0.13px15pxRoboto
App name<title>torq-typ--brandingBrandingBold15pxAuto20pxRoboto Slab

*Sizes are actually implemented using rem, assuming a base font size of 16px.

Tag Defaults

Using any of the HTML tags listed in the table above will automatically apply the corresponding font characteristics.

<h4>This is a section header</h4>

Font Profile CSS Classes

Each font profile has an accompanying CSS class.

<div class="torq-typ--section-header">This is also a section header.</div>

Sass Mixins

A Sass mixin can also be used to apply the various font profiles. Use the same names from the css classes.

.custom-section-header {
  @include torq-typ(section-header);
}

Font Weights

WeightValueCSS Class
Thin**100weight--thin
Light300weight--light
Regular400weight--regular
Medium500weight--medium
Bold700weight--bold
Black**900weight--black

**Not normally used in Torq Design, but available in Roboto font with a customized import

Adjust font weights using the available CSS classes.

<div class="weight--bold">This is some bold text.</div>

Acknowledgements

This component is a modified version of Google's Material Design for Web typography component.

0.4.0

5 years ago

0.3.4

5 years ago

0.3.3

5 years ago

0.3.2

5 years ago

0.3.1

5 years ago

0.3.0

5 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago