<header class=" c-header u-size-full u-py-base">
<div class="u-flex u-items-center">
<div class="u-ml-small u-ml-large@md" data-toggle-menu onclick="this.classList &&
document.querySelectorAll('[data-toggle-menu]').forEach( function(oNode){ oNode.classList.toggle('is-active');}) ,
document.querySelectorAll('[data-search]').forEach( function(oNode){ oNode.classList.remove('is-active');}) ,
document.querySelectorAll('[data-menu]').forEach( function(oNode){ oNode.classList.toggle('is-open');}) ,
document.querySelectorAll('[data-body-lock]').forEach( function(oNode){ oNode.classList.toggle('is-locked'); }) ,
document.querySelectorAll('[data-item-navigation]').forEach( function(oNode){ oNode.classList.toggle('is-visible-from-tablet'); }),
document.querySelectorAll('[data-search-bar]').forEach( function(oNode){ oNode.classList.add('is-hidden');})">
<svg class="o-icon o-icon--md u-cursor-pointer" data-toggle-menu-open>
<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#icon-menu"></use>
</svg>
<svg class="o-icon o-icon--md is-hidden u-cursor-pointer" data-toggle-menu-close>
<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#icon-x"></use>
</svg>
</div>
<div class="u-ml-auto u-mr-small u-mr-large@md">
<a href="/">
<svg class="c-brand
c-brand--small
" viewBox="0 0 500 50" xmlns="http://www.w3.org/2000/svg">
<path d="M22.5 40.6l1.5 8.5h10.5L24.5.9H10L0 49.1h10.2l1.4-8.5h10.9zM278.3 0c11 0 17.7 6.6 17.7 25 0 18.3-6.6 25-17.7 25-11 0-17.7-6.5-17.7-25 0-18.3 6.6-25 17.7-25zM53.2 0c9.7 0 14.3 5.5 15.6 13.8l-9.6 2.6c-.7-3.7-2.2-6.8-6.4-6.8-4.6 0-6.8 4-6.8 14.5 0 11.9 2.5 16.3 7.8 16.3 4 0 5.8-2.2 6.3-4.3v-4.8h-7v-9.5h16.4V49h-9.2v-3h-.2a11 11 0 01-8.6 3.6c-8.3 0-15.9-5.7-15.9-25C35.6 6.2 42.6 0 53.2 0zm86.7 0c9.8 0 14.3 5.5 15.6 13.8l-9.6 2.6c-.7-3.7-2.2-6.8-6.3-6.8-4.7 0-7 4-7 14.5 0 11.9 2.6 16.3 8 16.3 3.9 0 5.7-2.2 6.3-4.3v-4.8h-7v-9.5h16.3V49h-9.1v-3h-.2a11 11 0 01-8.6 3.6c-8.4 0-16-5.7-16-25 0-18.6 7-24.7 17.6-24.7zM89.1.9c9.5 0 14.4 6.5 14.4 15.9 0 5.9-2.2 10.5-6.5 12.7l7.6 19.6H93.3l-6-17.4-1.4.1h-1.4v17.3h-10V.9zm29.1 0v48.2h-10V.9h10zm69.3 0v9.6h-16.3v9.3h12.2V29h-12.2v10.4H188V49h-26.7V.9h26.3zm15.2 0l12.9 28h.2V.9h9.6v48.2h-10.2l-12.9-27h-.2v27h-9.6V.9h10.2zm56.2 0v9.6h-9.8V49h-10V10.5h-9.8V.9h29.6zm19.4 8.7c-5 0-7.4 3.6-7.4 15.3 0 11.9 2.4 15.5 7.4 15.5s7.4-3.5 7.4-15.3c0-12-2.5-15.5-7.4-15.5zm-261.1.8l1.5 9 2.1 12h-7.5l2.1-12.1 1.5-8.9h.3zm71.2 0h-4v13h4.2c2.9 0 4.8-2 4.8-6.5 0-4-1.7-6.5-5-6.5z" class="c-brand__edition"></path>
<path d="M356.8 0c11 0 17.8 6.6 17.8 25 0 18.3-6.6 25-17.8 25-11 0-17.8-6.5-17.8-25 0-18.3 6.7-25 17.8-25zm-44.6.9l13 28h.1V.9h9.6v48.2h-10.2l-12.9-27h-.2v27H302V.9h10.2zm93.8 0v9.6h-10V49h-10V10.5h-9.9V.9H406zm14 0v48.2h-10.1V.9h10zm33 0V11l-13.4 22.2-3.7 6 .1.3h17.2v9.6h-28.7v-9.7L438.8 16l3.3-5.4-.1-.2h-17V.9h28zm14.9 0v48.2h-10.1V.9h10zm31.8 0v9.6h-16.4v9.3h12.2V29h-12.2v10.4H500V49h-26.8V.9h26.5zM356.8 9.6c-5 0-7.4 3.6-7.4 15.3 0 11.9 2.4 15.5 7.4 15.5s7.4-3.5 7.4-15.3c0-12-2.5-15.5-7.4-15.5z" class="c-brand__network"></path>
</svg>
</a>
</div>
</div>
</header>
<header class="{% if transparent %}c-header--wide-transparent u-absolute {% else %} c-header {% endif %} u-size-full u-py-base">
<div class="u-flex u-items-center">
<div class="u-ml-small u-ml-large@md" data-toggle-menu onclick="this.classList &&
document.querySelectorAll('[data-toggle-menu]').forEach( function(oNode){ oNode.classList.toggle('is-active');}) ,
document.querySelectorAll('[data-search]').forEach( function(oNode){ oNode.classList.remove('is-active');}) ,
document.querySelectorAll('[data-menu]').forEach( function(oNode){ oNode.classList.toggle('is-open');}) ,
document.querySelectorAll('[data-body-lock]').forEach( function(oNode){ oNode.classList.toggle('is-locked'); }) ,
document.querySelectorAll('[data-item-navigation]').forEach( function(oNode){ oNode.classList.toggle('is-visible-from-tablet'); }),
document.querySelectorAll('[data-search-bar]').forEach( function(oNode){ oNode.classList.add('is-hidden');})">
<svg class="o-icon {% if transparent %}o-icon--inverse{% endif %} o-icon--md u-cursor-pointer" data-toggle-menu-open >
<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#icon-menu"></use>
</svg>
<svg class="o-icon {% if transparent %}o-icon--inverse{% endif %} o-icon--md is-hidden u-cursor-pointer" data-toggle-menu-close >
<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#icon-x"></use>
</svg>
</div>
<div class="u-ml-auto {% if sponsored or centered %}u-mr-auto{% else %}u-mr-small u-mr-large@md{% endif %}">
<a href="/">
{% if not (header_inverse) %}
{% render "@brand", {modifier: 'small', local: true}, true %}
{% else %}
{% render "@brand", {modifier: 'small', inverse: true, local: true, shadow: 'true'}, true %}
{% endif %}
</a>
</div>
{% if sponsored %}
<div class="u-mr-small u-mr-large@md u-text-right">
<span class="u-label-10 u-block u-uppercase u-color-inverse u-svg-shadow">publisher</span>
<span class="u-label-10 u-block u-uppercase u-color-inverse u-svg-shadow">partner</span>
</div>
{% endif %}
</div>
</header>
{
"channel": "Cronaca",
"navigation": [
{
"nav": null,
"name": "Notizie",
"channel": "/notizie/",
"active": true,
"list": [
{
"item": null,
"name": "Politica"
},
{
"item": null,
"name": "Economia"
},
{
"item": null,
"name": "Europa"
},
{
"item": null,
"name": "Cronaca"
},
{
"item": null,
"name": "Mondo"
},
{
"item": null,
"name": "Ambiente"
},
{
"item": null,
"name": "Green"
},
{
"item": null,
"name": "Attualità"
},
{
"item": null,
"name": "Città"
}
]
},
{
"nav": null,
"name": "Lifestyle",
"channel": "/lifestyle/",
"active": false,
"list": [
{
"item": null,
"name": "Benessere"
},
{
"item": null,
"name": "Casa"
},
{
"item": null,
"name": "Cucina"
},
{
"item": null,
"name": "Donna"
},
{
"item": null,
"name": "Gossip"
},
{
"item": null,
"name": "Salute"
},
{
"item": null,
"name": "Viaggi"
},
{
"item": null,
"name": "Spettacoli"
},
{
"item": null,
"name": "Motori"
}
]
},
{
"nav": null,
"name": "Cultura",
"channel": "/cultura/",
"active": false,
"list": [
{
"item": null,
"name": "Cinena"
},
{
"item": null,
"name": "Eventi"
},
{
"item": null,
"name": "Formazione"
},
{
"item": null,
"name": "Scienze"
}
]
},
{
"nav": null,
"name": "Opinioni",
"channel": "/opinioni/",
"active": false,
"list": [
{
"item": null,
"name": "Asso di denari"
},
{
"item": null,
"name": "Cronache marziane"
},
{
"item": null,
"name": "Curarsi mangiando"
},
{
"item": null,
"name": "Famiglia creativa"
},
{
"item": null,
"name": "FotoGrammi"
}
]
},
{
"nav": null,
"name": "Altre sezioni",
"active": false,
"list": [
{
"item": null,
"name": "Foto"
},
{
"item": null,
"name": "Video"
},
{
"item": null,
"name": "Best - Guida allo shopping"
}
]
}
]
}
// Name: Header
// Description: Header of website
//
// Component: `c-header`
//
// Variants: `c-header--inverse`
// Variants: `c-header--wide`
//
// Dependencies: `settings/v7/colors.tokens`
// `settings/v7/colors.mode`
// `settings/v7/spacing.tokens`
// `settings/v7/typography.map`
// `tools/v7/typography`
//
// ========================================================================
// Variables
// ========================================================================
$header-navbar-line: $global-active-line;
// ========================================================================
.c-header {
// Custom properties
// ========================================================================
--header-background: var(--theme-color);
--nav-border: #{$ui-01};
// ========================================================================
background-color: var(--header-background);
@include bp(md) {
--nav-border: var(--theme-color);
--header-background: var(--background-color-gray);
@if $layout == amp {
[data-theme="today"] & {
--header-background: var(--theme-color);
}
}
}
@if $layout == wide {
position: fixed;
z-index: var(--header-z-index);
}
//
// Inverse variant
//
&--inverse{
--header-background: var(--background-color);
}
//
// Wide variant
//
&--wide-transparent {
--header-z-index:99;
z-index: var(--header-z-index);
background-color: #{rgba($ui-06,.1)};
body[data-model="sponsor"] & {
--header-z-index: 999;
}
}
//
// Header focus area
//
// Check if $amp IS NOT true
@if $layout != amp {
&__focus {
display: none;
@include bp(lg) {
display: block;
margin-top: $margin-xsmall;
margin-bottom: $margin-xsmall;
padding: $padding-xsmall $padding-small;
overflow: hidden;
}
// Set background and link colors depending on [data-theme]
body[data-theme="today"] & {
background-color: var(--theme-color-darker);
.o-link-text {
color: $link-01;
}
}
// Set background and link colors depending on [data-theme]
body:not([data-theme="today"]) & {
background-color: var(--background-color);
.o-link-text {
color: var(--link-color-dark);
}
}
}
}
//
// Header channel
//
&__channel {
--channel-link: var($ui-04);
color: var(--channel-link);
text-decoration: none;
@include type(title-07);
@include bp(md){
@include type(title-03);
}
// Hide channel title when header varianti is 'inverse'
.c-header--inverse & {
display: none;
}
}
//
// Header top section
//
&__top {
position: relative;
@include bp(md) {
min-width: 60%;
}
// box-shadow: inset 0 -1px rgba($ui-01, .15);
&::after {
content: '';
position: absolute;
bottom: 0;
margin: 0 calc(var(--outer-gutter) * -1);
width: calc(100% + var(--outer-gutter) * 2);
display: block;
height: 1px;
background-color: $ui-01-10;
@include bp(md) {
display: none
}
}
}
}
// Navbar
// ========================================================================
.c-navbar {
&__subscription {
right: 2rem;
top: .9rem;
@include bp(sm) {
top: 1.2rem;
}
}
&__toggle {
margin-left: auto;
top: $padding-base;
right: $padding-small;
position: fixed;
@include z(higher);
@include bp(sm) {
top: 1.25rem;
}
@include bp(md) {
position: relative;
top: auto;
right: auto;
margin-left: $margin-medium;
}
}
&__toggle-shadow {
border-radius: $global-radius;
top: $padding-xsmall;
right: $padding-xsmall;
background-color: rgba(21,16,16,.55);
@include z(upside);
height: $margin-large;
width: $margin-large;
}
&__search {
.c-header:not(.c-header--slim) &{
@include bp(md) {
margin-left: $margin-small;
}
}
}
&__item {
--item-link-color: #{$ui-01};
color: var(--item-link-color);
@include bp(md) {
--item-link-color: #{$ui-02};
}
white-space: nowrap;
text-decoration: $link-decoration;
position: relative;
padding: $padding-small 0;
transition: box-shadow .3s ease-in;
@include type(nav-04);
@include bp(md) {
@include type(nav-06);
}
& + & {
margin-left: $margin-base;
}
&:hover,
&.is-active {
box-shadow: inset 0 -#{$header-navbar-line} var(--nav-border);
}
body[data-channel*="foto"] &,
body[data-model*="video"] &,
body[data-channel*="video"] &,
[data-color-scheme*="dark"] &{
--item-link-color: #{$ui-01};
}
}
&__search,
&__controller {
color: $icon-inverse;
.c-header--inverse & {
color: $icon-color;
}
@include bp(md) {
color: $icon-color;
@if $layout == amp {
[data-theme="today"] & {
color: $ui-01;
}
}
}
}
}
[data-toggle-menu] {
&.is-active {
[data-toggle-menu-open] {
display: none;
}
[data-toggle-menu-close] {
display: block;
}
}
[data-toggle-menu-open] {
display: block;
}
[data-toggle-menu-close] {
display: none;
}
}
[data-search] {
&.is-active {
[data-search-open] {
display: none;
}
[data-search-close] {
display: block;
}
}
[data-search-open] {
display: block;
}
[data-search-close] {
display: none;
}
}
The Header component as main element is present on all the pages of the project, this contains information on the existing header, on any focus in evidence, and on all pages navigable through the navigation bar.
The structure of the component, in detail, provides
The component is completely responsive, based on the spatial resolution adopted on the device it presents or omits information, e.g. in the mobile version the two focuses are automatically hidden.
It comes along with 2 different templates:
hedaer.njk
default layout;header--slim.njk
generally this version will be used in the internal pages of the websites of the publications.The background color of the component varies according to the newspaper (blue for Today.it, yellow for the RomaToday.it header, etc …) through a global class set on body HTML node:
<body class="t-today" style="margin: 0; padding: 0">