Origami Frontend Components & Services

JSDoc: o-typography

new Typography(typographyEl, opts)

Class constructor.

parameter type default description
typographyEl (optional) HTMLElement The root element to apply typography classes.
opts (optional) Object {loadOnInit: true, rejectOnFontLoadFailure: false, fontLoadedCookieName: 'o-typography-fonts-loaded'} An options object for configuring o-typography.

Methods

Links

Typography.getOptions(typographyEl)

Static Method

Get the data attributes from the typographyEl. If typography is being set up declaratively, this method is used to extract the data attributes from the DOM.

parameter type default description
typographyEl HTMLElement The typography element in the DOM (Required)

Links

Typography.checkOptions(opts)

Static Method

Check the options passed in are valid, otherwise set defaults

parameter type default description
opts Object An Object with configuration options for typography

Returns

  • Object - opts

Links

Typography.init(rootElement, options)

Static Method

Initialise o-typography.

parameter type default description
rootElement HTMLElement | String The root element to intialise o-typography on, or a CSS selector for the root element
options (optional) Object {} An options object for configuring o-typography

Links

new Typography(typographyEl, opts)

Class constructor.

parameter type default description
typographyEl (optional) HTMLElement The root element to apply typography classes.
opts (optional) Object {loadOnInit: true, rejectOnFontLoadFailure: false, fontLoadedCookieName: 'o-typography-fonts-loaded'} An options object for configuring o-typography.

Methods

Links

Support Status
active
Switch component view

GitHub Repository

Install o-typography

If using the Build Service, add o-typography@^6.4.3 to your script and link tags.

If running a Manual Build, run bower install --save "o-typography@^6.4.3".

Help & Support

o-typography is maintained directly by the Origami team. If you have any questions about o-typography 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