<div class="hero hero--top-level-lp">
<div class="hero__text-wrap">
<nav class="iastate22-breadcrumb iastate22-breadcrumb--top-level-pages" aria-label="Breadcrumb">
<ol class="iastate22-breadcrumb__list">
<li>
<a href="https://www.iastate.edu/">Home</a>
</li>
<li>
<a href="https://www.iastate.edu/" aria-current="page">Primary Nav 1</a>
</li>
</ol>
</nav>
<h1 class="hero__title">Kitchen Sink</h1>
</div>
<div class="hero__media">
<img src="../../img/Heroes-Kitchen_Sink.jpg" alt="" loading="lazy" width="1770" height="662">
</div>
<div class="hero__subnav-wrap">
<nav class="subnav subnav--horizontal" aria-label="Sidebar">
<div class="subnav__list" id="subnav-list">
<ul>
<li>
<a href="https://www.iastate.edu/">Level 2 Page Lorem Ipsum</a>
</li>
<li>
<a href="https://www.iastate.edu/">Level 2 Page Lorem</a>
</li>
<li>
<a href="https://www.iastate.edu/">Level 2 Page Lorem Ipsum Dolor Sit Amet</a>
</li>
<li>
<a href="https://www.iastate.edu/">Level 2 Page Lorem</a>
</li>
<li>
<a href="https://www.iastate.edu/">Level 2 Page Lorem Ipsum Dolor</a>
</li>
</ul>
</div>
</nav>
</div>
</div>
<div class="hero hero--top-level-lp{% if not image %} hero--top-level-lp--no-media{% endif %}">
<div class="hero__text-wrap">
{% include "@breadcrumb--top-level-pages" with breadcrumbs %}
<h1 class="hero__title">{{title}}</h1>
</div>
{% if image %}
<div class="hero__media">
<img src="{{image}}" alt="" loading="lazy" width="1770" height="662">
</div>
{% endif %}
{% if subnav_horizontal %}
<div class="hero__subnav-wrap">
{% include "@subnav--horizontal" with subnav_horizontal %}
</div>
{% endif %}
</div>
{
"breadcrumbs": {
"links": [
{
"url": "https://www.iastate.edu/",
"name": "Home"
},
{
"url": "https://www.iastate.edu/",
"name": "Parent Page"
},
{
"url": "https://www.iastate.edu/",
"name": "Kitchen Sink"
}
]
},
"title": "Kitchen Sink",
"image": "../../img/Heroes-Kitchen_Sink.jpg",
"subnav": {
"items": [
{
"url": "https://www.iastate.edu/",
"title": "Parent Page",
"current": false,
"children": []
},
{
"url": "https://www.iastate.edu/",
"title": "Sibling Page Title Lorem Ipsum",
"current": false,
"children": []
},
{
"url": "https://www.iastate.edu/",
"title": "Sibling Page Title Lorem Ipsum",
"current": false,
"children": []
},
{
"url": "https://www.iastate.edu/",
"title": "Sibling Page Title Lorem Ipsum",
"current": false,
"children": []
},
{
"url": "https://www.iastate.edu/",
"title": "Kitchen Sink",
"current": true,
"children": [
{
"url": "https://www.iastate.edu/",
"title": "Child Page Title Lorem",
"current": false,
"children": []
},
{
"url": "https://www.iastate.edu/",
"title": "Child Page Title Lorem",
"current": false,
"children": []
}
]
},
{
"url": "https://www.iastate.edu/",
"title": "Sibling Page Title Lorem Ipsum",
"current": false,
"children": []
}
]
},
"subnav_horizontal": {
"items": [
{
"url": "https://www.iastate.edu/",
"title": "Level 2 Page Lorem Ipsum"
},
{
"url": "https://www.iastate.edu/",
"title": "Level 2 Page Lorem"
},
{
"url": "https://www.iastate.edu/",
"title": "Level 2 Page Lorem Ipsum Dolor Sit Amet"
},
{
"url": "https://www.iastate.edu/",
"title": "Level 2 Page Lorem"
},
{
"url": "https://www.iastate.edu/",
"title": "Level 2 Page Lorem Ipsum Dolor"
}
]
}
}
.hero {
margin-bottom: rem(126);
position: relative;
@include media-breakpoint-up(lg) {
padding-top: rem(40);
}
@include media-breakpoint-up(xl) {
margin-bottom: 0;
}
&.hero--top-level-lp {
@include media-breakpoint-up(lg) {
padding-top: rem(25);
margin-bottom: rem(65);
margin-right: rem(-110);
}
}
&.hero--no-media,
&.hero--top-level-lp--no-media {
@include media-breakpoint-up(xl) {
margin-bottom: rem(40);
}
}
}
.hero__title {
margin: 0;
font-size: rem(36);
font-weight: 600;
@include media-breakpoint-up(sm) {
font-size: rem(50);
font-weight: 400;
}
@include media-breakpoint-up(md) {
font-size: rem(70);
line-height: (93 / 70);
}
@include media-breakpoint-up(lg) {
margin: rem(25) 0 rem(10) 0;
}
}
.hero__text-wrap {
margin-bottom: rem(10);
@include media-breakpoint-up(xl) {
margin-left: rem(-108);
}
.hero--top-level-lp & {
margin-top: rem(24);
margin-bottom: rem(20);
@include media-breakpoint-up(lg) {
margin-bottom: rem(10);
}
}
}
.hero__media {
@extend %responsive-img;
margin: 0 rem(-11) rem(30) rem(-36);
@include media-breakpoint-up(md) {
margin-left: rem(-70);
margin-right: rem(130);
}
@include media-breakpoint-up(xl) {
margin-left: rem(-190);
margin-right: rem(-110);
}
.hero--top-level-lp & {
margin-right: rem(-36);
@include media-breakpoint-up(md) {
margin-right: rem(-70);
}
@include media-breakpoint-up(xl) {
margin-right: 0;
}
}
&:before {
padding-top: 37.4%;
}
}
.hero__subnav-wrap {
z-index: 2;
max-width: rem(342);
position: absolute;
@include media-breakpoint-up(xl) {
top: 0;
right: rem(-70);
left: initial;
max-width: rem(278);
}
@include media-breakpoint-up(xl) {
right: rem(-298);
}
// top level lp horizontal version
.hero--top-level-lp & {
@include media-breakpoint-up(lg) {
top: initial;
right: initial;
left: 0;
position: relative;
margin-top: rem(-53);
margin-bottom: rem(58);
max-width: none;
}
@include media-breakpoint-up(xl) {
right: initial;
margin-right: rem(-109);
}
}
.hero--top-level-lp--no-media & {
margin-top: rem(30);
}
}
.hero--news-article,
.hero--event-detail {
position: relative;
background-color: $white;
padding-top: rem(50);
@include media-breakpoint-up(md) {
margin-inline: rem(-35);
}
@include media-breakpoint-up(lg) {
padding-top: rem(70);
}
@include media-breakpoint-up(xl) {
margin-inline: rem(-158) rem(-251);
}
@include media-breakpoint-up(xxl) {
margin-inline: rem(-110) rem(-207);
}
}
.hero--news-article__headline,
.hero--event-detail__headline {
color: $iastate-red;
.hero--news-article--cyclone-story &,
.hero--event-detail--cyclone-story & {
width: 75%;
}
}
.hero--news-article__subhead {
font-family: $typeface-sans-serif;
font-weight: 700;
color: $iastate-maroon;
font-size: rem(21);
line-height: (30 / 21);
margin: 0;
position: relative;
&:after {
content: "";
position: absolute;
bottom: rem(-25);
width: rem(50);
border-bottom: rem(2) solid $iastate-gold;
left: 0;
}
.hero--news-article--cyclone-story &,
.hero--event-detail--cyclone-story & {
width: 75%;
}
}
.hero--news-article__cyclone-stories-logo {
position: absolute;
right: 0;
top: rem(60);
@include media-breakpoint-up(lg) {
top: rem(120);
}
}
.hero--news-article__date {
//letter-spacing: rem(1);
//text-transform: uppercase;
color: $grey4;
margin-top: rem(20);
}
.hero--news-article__attribution {
margin-top: rem(20);
}
.hero--news-article__date + .hero--news-article__attribution {
margin-top: rem(10);
}
.hero--news-article__media,
.hero--event-detail__media {
margin-top: rem(40);
@extend %responsive-img;
&:before {
padding-top: 56.27%;
}
}
This is a custom component (no class prefix in place as it does not conflict with bootstrap)
default
for the main site (which places the subnav
in the top right on desktop), and the --top-level-lp
variant for for top-level landing pages (contains a modified version of the subnav
below the main image)hero__media
element will be inline img
and is sized using the css object-fit
property (a polyfill is included for older browsers)image
field is optionalbreadcrumb
and subnav
index.scss
file as @import "../components/hero/hero";
<main>
element: <div class="off-canvas">
<div class="max-bound">
{% include "@site-header" with header %}
<main id="main-content">