@financial-times/o-typography
Advanced tools
Comparing version 6.2.0 to 6.3.0
@@ -28,3 +28,3 @@ { | ||
"name": "@financial-times/o-typography", | ||
"version": "6.2.0", | ||
"version": "6.3.0", | ||
"dependencies": { | ||
@@ -34,3 +34,3 @@ "fontfaceobserver": "^2.0.9", | ||
"@financial-times/o-colors": "^5.0.0", | ||
"@financial-times/o-fonts": "^4.1.0", | ||
"@financial-times/o-fonts": "^4.3.0", | ||
"@financial-times/o-grid": "^5.0.0", | ||
@@ -37,0 +37,0 @@ "@financial-times/o-icons": "^6.0.0", |
@@ -155,11 +155,9 @@ # o-typography [![Build Status](https://circleci.com/gh/Financial-Times/o-typography.png?style=shield&circle-token=9ca314332de2a9b6a80eb8477e097d9acbc96e0b)](https://circleci.com/gh/Financial-Times/o-typography) [![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](#licence) | ||
```scss | ||
// configure o-typography to not include fonts | ||
$o-typography-load-fonts: false; | ||
// import dependencies | ||
@import 'o-typography/main'; | ||
@import 'o-fonts/main'; | ||
// include css for select fonts manually | ||
@include oFontsInclude(MetricWeb, regular); | ||
@include oFontsInclude(FinancierDisplayWeb, regular); | ||
@include oFontsInclude(FinancierDisplayWeb, bold); | ||
// configure o-typography to not include fonts | ||
$o-typography-load-fonts: false; | ||
// include a limited set of recommended font families manually | ||
@include oFonts($opts: ('recommended': true)); | ||
// include css for all typography | ||
@@ -169,2 +167,24 @@ @include oTypography(); | ||
If an `oTypography` mixin outputs a font family/weight/style for a font face which hasn't been included in the project it is possible to throw an error by setting `$o-typography-error-for-missing-fonts` to an error message. A custom error message is useful as what the engineer should do depends on the project. | ||
```scss | ||
// import dependencies | ||
@import 'o-typography/main'; | ||
@import 'o-fonts/main'; | ||
// configure o-typography to not include fonts | ||
$o-typography-load-fonts: false; | ||
// error if a font is used which has not been included | ||
$o-typography-error-for-missing-fonts: 'This project only allows recommended o-fonts! No fun for you without first discussing performance with the Font Guardians of this project.'; | ||
// include a limited set of recommended font families manually | ||
@include oFonts($opts: ('recommended': true)); | ||
// try to use a font which is not recommended, | ||
// and has not been included with o-fonts | ||
.fancy-typography-used-only-here { | ||
// throws an error which includes the `$o-typography-error-for-missing-fonts` message. | ||
// a thin/italic font face has not been included | ||
@include oTypographySans($scale: 1, $weight: 'thin', $style: 'normal'); | ||
} | ||
``` | ||
The Sass in o-typography also provides several mixins for use in your project. To explore all functions/mixins see the [SassDoc documentation](sassdoc) in the registry. | ||
@@ -171,0 +191,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
131202
506