This component is for displaying collections of o-teasers.
Check out how to include Origami components in your project to get started with o-teaser-collection
.
The basic markup structure for a teaser collection will look something like this:
<div class="o-teaser-collection">
<h2 class="o-teaser-collection__heading">
<a class="o-teaser-collection__heading-link" href="#">UK</a>
</h2>
<!-- Teasers go here -->
</div>
Teaser collections can be arranged using o-grid, or by using the o-teaser-collection__items
and o-teaser-collection__item
classes. These classes are designed to work on list elements, as seen in the o-teaser-collection--numbered
example:
<div class="o-teaser-collection o-teaser-collection--numbered">
<h2 class="o-teaser-collection__heading o-teaser-collection__heading--full-width">Most read</h2>
<ol class="o-teaser-collection__items">
<li class="o-teaser-collection__item">
teaser goes here
</li>
<li class="o-teaser-collection__item">
teaser goes here
</li>
</ol>
</div>
Teaser Collections can be customised using several modifier classes.
To include all styles call the oTeaserCollection
mixin.
@include oTeaserCollection();
o-teaser-collection
css may be included granularly by passing options to the oTeaserCollection
mixin.
@include oTeaserCollection($opts: (
'collections': ('special'), // o-teaser-collection--special
'headings': ('inverse'), // o-teaser-collection__heading--inverse
'items': ('stretched') // o-teaser-collection__item--stretched
));
Options include:
Use o-teaser-collection--numbered
to number the list of teasers in the collection, see an example in the registry.
Use o-teaser-collection--special
to add a darker background across the full width of the containing relative element, see an example in the registry.
To include heading styles output o-teaser-collection__heading
classes using the oTeaserCollection
mixin as described above. If your component or project would like to replicate only some parts of the heading style use oTeaserCollectionContentHeading
.
For example, to replicate only the basic heading style pass an empty map:
.my-heading {
@include oTeaserCollectionContentHeading($opts: ());
}
To replicate the header fully, but without the size modifiers such as o-teaser-collection__heading--full-width
:
.my-heading {
@include oTeaserCollectionContentHeading($opts: (
'anchor': true, // Include child anchor styles `.my-heading > a`
'divider': true, // Include the top border styles.
'sizes': () // Do not output size modifiers such as `.my-heading--small`.
));
}
oTeaserCollectionContentHeading
options include:
If you have any questions or comments about this component, or need help using it, please either raise an issue, visit #origami-support or email Origami Support.
This software is published by the Financial Times under the MIT licence.