6.0.8 • Published 7 months ago

@financial-times/o-topper v6.0.8

Weekly downloads
665
License
MIT
Repository
-
Last release
7 months ago

o-topper

This component is used for styling the topper sections of an article.

Usage

Check out how to include Origami components in your project to get started with o-topper.

Markup

The basic markup structure for a topper will look something like this:

<div class="o-topper o-topper--basic o-topper--color-paper">
	<div class="o-topper__content">
		<div class="o-topper__tags">
			<a href="https://www.ft.com/german-election" class="o-topper__topic">German election</a>
		</div>
		<h1 class="o-topper__headline">
			Merkel reaches ‘grand coalition’ breakthrough with Social Democrats
		</h1>
		<div class="o-topper__standfirst">Move raises hopes of end to political deadlock that has gripped Germany since September</div>
	</div>

	<div class="o-topper__background"></div>
</div>

Toppers support a wide array of elements and can be customised using several themes and background colors. For a full list of examples, including example markup, see o-topper in the Registry.

Supported elements

ElementUse case
.o-topper__contentMain content area of topper. Required parent of all elements except __visual and __background.
.o-topper__tagsWrapper element for the article concept tag elements __brand, __topic and __opinion-genre.
.o-topper__brandA concept tag that represents a brand, e.g. "The Big Read".
.o-topper__topicA concept tag that represents a topic or generic concept.
.o-topper__opinion-genreA concept tag that represents the abstract Opinion genre.
.o-topper__columnistWrapper element for __columnist-name. Should be placed below the headline and standfirst.
.o-topper__columnist-nameRepresents the columnist that wrote an Opinion genre article.
.o-topper__headlineThe main headline of the article.
.o-topper__standfirstA short introduction to the article.
.o-topper__backgroundElement used to display the editorially-chosen colored background of the topper. Must be empty.
.o-topper__visualWrapper for the visual elements __picture and __image. Should be a <figure> tag.
.o-topper__pictureA <picture> tag visual element.
.o-topper__imageAn <img> tag visual element, usually used as fallback for a <picture>.
.o-topper__image-creditElement showing credit/copyright for the __picture or __image, where no image caption is given. If an image caption is provided alongside credit/copyright information use .o-topper__image-caption instead. Should be a <figcaption> tag.
.o-topper__image-captionElement showing caption and credit/copyright together for the __picture or __image. Should be a <figcaption> tag.

Themes

These themes affect the layout and visual style of all elements. See the demos for examples.

.o-topper--basic
.o-topper--branded
.o-topper--opinion
.o-topper--full-bleed-image-left
.o-topper--full-bleed-offset
.o-topper--split-text-left
.o-topper--split-text-center
.o-topper--deep-landscape
.o-topper--deep-portrait

Colors

These colors affect the background of the .o-topper__background and .o-topper__visual elements, and select a contrasting text color for all other elements. See o-colors for examples of the colors.

.o-topper--color-paper
.o-topper--color-wheat
.o-topper--color-white
.o-topper--color-black
.o-topper--color-claret
.o-topper--color-oxford
.o-topper--color-slate
.o-topper--color-crimson
.o-topper--color-sky
.o-topper--color-matisse

Modifiers

ModifierUse case
.o-topper__content--background-boxCreate a background box around the element .o-topper__content. The background colour of the box
will be defined based on the background of the topper

Sass

To include all o-topper CSS include oTopper:

@import '@financial-times/o-topper/main';
@include oTopper();

To include o-topper styles granularly specify which elements, themes, and colours to output styles for using the options $opts argument:

@include oTopper($opts: (
	'themes': (
		'branded', // .o-topper--branded
		'opinion', // .o-topper--opinion
		'has-headshot', // .o-topper--has-headshot
		'full-bleed-offset',
		'split-text-left',
		'split-text-center',
		'full-bleed-image-center',
		'full-bleed-image-left',
		'package',
		'package-extra',
		'package-extra-wide',
		'package-special-report',
		'right-rail',
		'centered',
		'deep-landscape',
	),
	'elements': (
		'content', // .o-topper__content
		'visual', // .o-topper__visual
		'background', // .o-topper__background
		'headline',
		'headline--large',
		'summary',
		'standfirst',
		'summary--body',
		'tags',
		'columnist',
		'columnist-name',
		'brand',
		'topic',
		'read-next',
		'image',
		'image-credit',
		'image-caption'
	),
	'colors': (
		'white', // .o-topper--color-white
		'black', // .o-topper--color-black
		'claret',
		'oxford',
		'paper',
		'slate',
		'wheat',
		'crimson',
		'sky',
	)
));

Migration

StateMajor VersionLast Minor ReleaseMigration guide
✨ active6N/Amigrate to v6
⚠ maintained5N/Amigrate to v5
╳ deprecated44.0migrate to v4
╳ deprecated33.1migrate to v3
╳ deprecated22.7migrate to v2
╳ deprecated11.2-

Contact

If you have any questions or comments about this component, or need help using it, please either raise an issue, visit #ft-origami or email Origami Support.

Licence

This software is published by the Financial Times under the MIT licence.

6.0.7

9 months ago

6.0.8

7 months ago

6.0.6

1 year ago

5.8.0

1 year ago

6.0.1

1 year ago

6.0.0

1 year ago

6.0.3

1 year ago

6.0.2

1 year ago

6.0.5

1 year ago

6.0.4

1 year ago

5.7.4

1 year ago

5.7.3

1 year ago

5.7.2

1 year ago

5.5.1

1 year ago

5.5.0

1 year ago

5.6.4

1 year ago

5.6.3

1 year ago

5.6.2

1 year ago

5.6.1

1 year ago

5.6.0

1 year ago

5.4.2

2 years ago

5.4.1

2 years ago

5.4.0

2 years ago

5.7.1

1 year ago

5.7.0

1 year ago

5.3.1

2 years ago

5.3.0

2 years ago

5.2.3

2 years ago

5.2.2

2 years ago

5.2.1

2 years ago

5.2.0

2 years ago

5.1.0

3 years ago

5.0.2

3 years ago

3.1.7

3 years ago

5.0.1

3 years ago

5.0.0

3 years ago

4.0.1

3 years ago

4.0.0

3 years ago

4.0.0-beta.0

3 years ago

3.1.6

3 years ago

3.1.5

3 years ago

3.1.4

3 years ago

3.1.3

3 years ago

3.1.2

3 years ago

3.1.1

3 years ago

3.1.0

4 years ago

3.1.0-beta.1

4 years ago

3.1.0-beta.0

4 years ago

3.0.6

4 years ago

3.0.5

4 years ago

3.0.4

4 years ago

3.0.3

4 years ago

3.0.2

4 years ago

3.0.1

4 years ago

3.0.0

4 years ago

2.7.2

5 years ago

2.7.1

5 years ago

2.7.0

5 years ago

2.6.2

5 years ago

2.6.1

5 years ago

2.6.0

5 years ago

2.5.0

5 years ago

2.4.0

5 years ago