Origami Frontend Components & Services

SassDoc: o-normalise

oNormalise(opts)

Outputs all o-normalise styles.

parameter type default description
opts A map of which normalise styles and helper classes to output.

Examples

Example #1

all o-normalise styles.

@include oNormalise();

Example #2

all o-normalise styles, without css class helpers such as o-normalise-visually-hidden.

@include oNormalise($opts: (
	'elements': ('forms', 'images', 'text', 'links'),
	'body': ('font-smoothing', 'focus', 'reduce-motion')
));

Links

oNormaliseVisuallyHidden

Visually hide an element while still allowing it to be read by a screenreader

Links

oNormaliseClearfix

Clearfix helper styles Outputs clearfix styles on the current element

Links

oNormaliseBoxSizing

Adds box sizing to current and all child elements

Links

oNormaliseFocusApply

Apply a focus style using :focus-visible with :focus fallback.

Example

Apply a focus style to a button using :focus-visible with :focus fallback.

button {
	@include oNormaliseFocusApply() {
		@include oNormaliseFocusContent();
	};
}

Links

oNormaliseFocusContent

Output focus state styles to apply explicitly to a given element.

Links

oNormaliseFocusContentInverse

Output focus state styles to apply explicitly to a given element with "inverse" theme (light on dark background).

Links

oNormaliseFocusContentForElementColour(color)

Output focus state styles for a block element of a given colour. Where the given colour refers to the background colour of the focused element, not the page background.

This is useful when dynamically creating new themes, where the colour of the element is not known in advance. Otherwise set either oNormaliseFocusContent or oNormaliseFocusContentInverse explicitly instead.

parameter type default description
color The background colour of the focused element.

Links

oNormaliseFocusUnsetContent

Undo a focus style applied by o-normalise.

Links

o-normalise-is-silent

Silent mode variable

Links

oNormalise(opts)

Outputs all o-normalise styles.

parameter type default description
opts A map of which normalise styles and helper classes to output.

Examples

Example #1

all o-normalise styles.

@include oNormalise();

Example #2

all o-normalise styles, without css class helpers such as o-normalise-visually-hidden.

@include oNormalise($opts: (
	'elements': ('forms', 'images', 'text', 'links'),
	'body': ('font-smoothing', 'focus', 'reduce-motion')
));

Links

Status
active
Switch component view

GitHub: o-normalise@3.3.1

Install o-normalise

If using the Build Service, add o-normalise@^3.3.1 to your link tag.

If using the npm package manager for a Manual Build, run npm install --save-peer "@financial-times/o-normalise@^3.3.1".

Help & Support

o-normalise is maintained directly by the Origami team. If you have any questions about o-normalise or Origami in general, we are happy to help. 😊

Slack: #origami-support
Email: origami.support@ft.com

Feedback / Issues

To report a bug or request features please create an issue on Github. For support or general feedback please get in touch 😊

Slack: #origami-support
Email: origami.support@ft.com