o-fonts

functions

[private] _oFontsVariantExists

@function _oFontsVariantExists($family, $weight, $style) { ... }

Description

Check if a font variant exists for a family

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$family

one of $o-fonts-families

Stringnone
$weightnoneStringnone
$stylenoneStringnone

Returns

Bool

Requires

Used by

Links

[private] _oFontsStringCapitalise

@function _oFontsStringCapitalise($string) { ... }

Description

Capitalise first letter of $string

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$string

string to update

Stringnone

Returns

String

Used by

Links

oFontsGetFontFamilyWithFallbacks

@function oFontsGetFontFamilyWithFallbacks($family) { ... }

Description

Get a font-family stack with the appropriate fallbacks

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$familynoneStringnone

Returns

String

font-stack

Example

font-family: oFontsGetFontFamilyWithFallbacks(FinancierDisplayWeb);

Throws

  • #{$family} has been removed. Please use either MetricWeb or FinancierDisplayWeb.

Requires

Links

oFontsUseAsset

@function oFontsUseAsset($asset) { ... }

Description

Path to a font asset

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$assetnoneStringnone

Returns

String

Path to the font asset, without the file extension

Requires

Used by

Links

oFontsWeight

@function oFontsWeight($keyword) { ... }

Description

Machine-readable CSS font-weight.

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$keyword

Human-readable keyword, one of $_o-fonts-weights

Stringnone

Returns

Number

CSS font-weight

Example

font-weight: oFontsWeight(lighter);

Requires

Used by

Links

mixins

oFontsSource

@mixin oFontsSource($fontName) { ... }

Description

Font-face declaration sources

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$fontName

path to the file, without the file extension

Stringnone

Requires

Used by

Links

oFontsInclude

@mixin oFontsInclude($family, $weight: regular, $style: normal) { ... }

Description

Font-face declaration for a given font family

Parameters

parameterNameparameterDescriptionparameterTypeparameterDefault value
$family

one of $o-fonts-families

Stringnone
$weight

one of $_o-fonts-weights

Stringregular
$stylenoneStringnormal

Throws

  • #{$family} has been removed, no font will be included.

Requires

Used by

Links

oFontsIncludeAll

@mixin oFontsIncludeAll() { ... }

Description

Output @font-face declarations for all the font families

Parameters

None.

Requires

Links

variables

o-fonts-path

$o-fonts-path: 'https://www.ft.com/__origami/service/build/v2/files/o-fonts-assets@1.3.2/' !default;

Description

Path to the assets

Type

String

Used by

Links

o-fonts-is-silent

$o-fonts-is-silent: true !default;

Description

Silent mode

Type

Bool

Links

o-fonts-families

$o-fonts-families: (
	MetricWeb: (
		font-family: 'MetricWeb, sans-serif',
		variants: (
			(weight: thin, style: normal),
			(weight: light, style: normal),
			(weight: light, style: italic),
			(weight: regular, style: normal),
			(weight: regular, style: italic),
			(weight: medium, style: normal),
			(weight: semibold, style: normal),
			(weight: bold, style: normal),
			(weight: bold, style: italic),
		)
	),
	FinancierDisplayWeb: (
		font-family: 'FinancierDisplayWeb, serif',
		variants: (
			(weight: light, style: italic),
			(weight: regular, style: normal),
			(weight: medium, style: italic),
			(weight: semibold, style: italic),
			(weight: bold, style: normal)
		)
	),
) !default;

Description

Font families

Type

Map

Used by

Links

[private] _o-fonts-weights

$_o-fonts-weights: (
	'thin':       100,
	'light':      200,
	'regular':    400,
	'normal':     400,
	'medium':     500,
	'semibold':   600,
	'bold':       700,
	'black':      800,
) !default;

Description

Human-readable Font-weights

Type

Map

Used by

Links

[private] _o-fonts-families-included

$_o-fonts-families-included: () !default;

Description

Map of families and styles which have already been included Used to avoid declarations from being multiple times in the CSS output

Used by

Links