Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(page-header): update page header according to DT spec - INNO-441 #153

Merged
merged 10 commits into from
May 31, 2017
2 changes: 1 addition & 1 deletion framework/base/variables/_colors.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// ECL Colors

$ecl-colors: (
blue-120: #003776,
blue-120: #012b58,
blue-110: #003776,
blue-100: #004494,
blue-75: #4073af,
Expand Down
2 changes: 2 additions & 0 deletions framework/components/ecl-breadcrumbs/_breadcrumbs.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* stylelint-disable */
$breadcrumb-heigth: 2.778em;

.breadcrumb {
Expand Down Expand Up @@ -40,6 +41,7 @@ a.breadcrumb__link {
&::after {
@extend .breadcrumb__link-arrow;

content: '\e828';
vertical-align: middle;
position: relative;
top: 1px;
Expand Down
222 changes: 48 additions & 174 deletions framework/components/ecl-page-headers/_page-headers.scss
Original file line number Diff line number Diff line change
@@ -1,205 +1,79 @@
// External link specific adjustments.
@mixin _page_header_external_link_mixin() {
display: inline-block;
padding-right: 1.1em;
// ECL page header

&::after {
position: absolute;
line-height: 2.2;
}

&.btn {
padding-right: 2.1em;
}
}

.page-header {
margin: 0;
padding: 0 0 1.5em;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any specific reason why removing this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't have any reason to keep it, as it didn't change the display

.ecl-page-header {
background-color: $ecl-color-primary;
color: #fff;
border-bottom: none;

h1 {
margin: 0;
line-height: 1.25;
color: #fff;

span {
margin-top: 0.175em;
line-height: 1.34;
font-size: 0.75em;
font-weight: 400;
}

.paragraph {
margin-bottom: 0;
}
&__body {
padding: map-get($ecl-spacing, 'xxs');
}

p {
max-width: 40em;
margin: 0;
line-height: 1.45;
font-size: map-get($ecl-font-size, 'l');
color: #fff;
&__meta {
margin-top: map-get($ecl-spacing, 's');
}

a {
color: #fff;

@include ecl-focus-outline-border(3px, map-get($ecl-colors, 'yellow-100'), 2px);

&:hover:not(.breadcrumb__link, .btn) {
color: map-get($ecl-colors, 'yellow-100');
}

&#{"[" + $ecl-external-link-pattern + "]"}:not(.is-internal, .listing__title) {
&:not(#{$ecl-ec-link-patterns}) {
@include _page_header_external_link_mixin();
}
}
}

.page-header__top,
.page-header__main,
.page-header__bottom {
display: block;
width: 100%;
}

.page-header__top {
text-transform: uppercase;
}

.page-header__main {
line-height: 1.15;
&__title {
margin-top: map-get($ecl-spacing, 'm');
}

.page-header__bottom {
font-size: 26px;
&__identity {
color: map-get($ecl-colors, 'blue-25');
font-size: map-get($ecl-font-size, 'l');
margin-bottom: map-get($ecl-spacing, 'xxs');
margin-top: map-get($ecl-spacing, 'xxs');
}

.page-header__hero-title {
padding-top: 2.39em;

.meta--header {
margin-bottom: 0;
}
&__intro {
font-size: map-get($ecl-font-size, 'l');
line-height: 1.33;
max-width: 40em;
}
}

.page-header--large-intro {
padding-bottom: 2.39em;

p {
font-size: map-get($ecl-font-size, 'xl');
line-height: 1.5;
&__label {
font-size: map-get($ecl-font-size, 'xs');
text-transform: uppercase;
}
}

.page-header--image {
background: transparent url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7) center/cover no-repeat;
}

// Drupal connect.
.node-type-info-homepage .page-header {
@extend .page-header--large-intro;
.ecl-page-header--image {
background-position: 50%;
background-repeat: no-repeat;
background-size: cover;
}

.page-header__eventinfo {
float: left;
font-size: map-get($ecl-font-size, 'xs');

.page-header__date--cancelled {
text-decoration: line-through;
}

.ecl-icon {
margin: 1em 2em 1em 0;
.ecl-page-header--highlight {
padding-bottom: map-get($ecl-spacing, 'm');

&::before {
margin-right: 0.5em;
}
.ecl-page-header__body {
background-color: map-get($ecl-colors, 'blue-120');
padding-bottom: map-get($ecl-spacing, 'xs');
}
}

.page-header--xlarge-intro {
min-height: 150px;
padding-bottom: 0;
@media (min-width: map-get($ecl-grid-breakpoints, 'sm')) {
.ecl-page-header--highlight {
padding-bottom: 0;

.page-header__hero-title {
min-height: 75px;
margin: 75px 0 0;
padding: 16px;
background-color: map-get($ecl-colors, 'blue-110');
.ecl-page-header__body {
background-color: $ecl-color-primary;
padding-bottom: map-get($ecl-spacing, 'xxl');
padding-top: map-get($ecl-spacing, 'xxl');
}
}

.field__label--above {
padding: 0;
color: #fff;
font-size: map-get($ecl-font-size, 's');
font-weight: 400;
text-transform: uppercase;
.ecl-page-header__label {
background-color: map-get($ecl-colors, 'blue-120');
display: inline-block;
line-height: 2.4;
padding-left: map-get($ecl-spacing, 'm');
padding-right: map-get($ecl-spacing, 'm');
}

p {
.ecl-page-header__highlight {
background-color: #fff;
color: $ecl-color-primary;
font-size: map-get($ecl-font-size, 'l');
}
}

@include ecl-media-breakpoint-up(msm) {
.page-header--xlarge-intro {
height: 320px;

.page-header__hero-title {
margin: auto;
padding-top: 5em;
background-color: transparent;
}

.field__label--above {
width: 146px;
height: 34px;
margin: 0;
line-height: 34px;
background-color: map-get($ecl-colors, 'blue-110');
text-align: center;
}

p {
width: 550px;
padding: 22px 5px 22px 33px;
background-color: #fff;
color: map-get($ecl-colors, 'blue-100');
}
}
}

.node-info-homepage.view-mode-homepage_political {
.page-header {
@extend .page-header--xlarge-intro;

.page-header__hero-title {
a {
text-decoration: none;

&:hover {
text-decoration: underline;
}
}
}

@include ecl-media-breakpoint-up(msm) {
.page-header__hero-title {
a {
color: map-get($ecl-colors, 'blue-100');

&:hover {
color: $ecl-color-shade;
}
}
}
}
max-width: 22em;
padding: map-get($ecl-spacing, 's') map-get($ecl-spacing, 'm');
}
}
9 changes: 9 additions & 0 deletions framework/components/ecl-page-headers/corporate/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Corporate page header

Following element are mandatory:
* Breadcrumb
* Page title
* Page introduction

Following elements are optional:
* Meta items

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 40 additions & 0 deletions framework/components/ecl-page-headers/corporate/corporate.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<div class="ecl-page-header {{modifier_class}}" {{style}}>
<!-- Breadcrumb (mandatory) -->
<nav class="breadcrumb breadcrumb-processed breadcrumb--collapsible ecl-u-mh-xxs" role="navigation" aria-label="breadcrumbs">
<ol class="breadcrumb__segments-wrapper">
<li class="breadcrumb__segment breadcrumb__segment--first">
<a href="#" class="breadcrumb__link is-internal" rel="home">
<span class="breadcrumb__text">European Commission</span>
</a>
</li>
<li class="breadcrumb__segment breadcrumb__segment--last">
<a href="#" class="breadcrumb__link">
<span class="breadcrumb__text">Announcements</span>
</a>
</li>
</ol>
</nav>

<div class="ecl-page-header__body">
<!-- Meta items (optional) -->
<div class="ecl-page-header__meta">
<div class="meta meta--header">
<span class="meta__item meta__item--type">News article</span>
<span class="meta__item">
<span class="date-display-single" property="dc:date" datatype="xsd:dateTime" content="2015-07-06T17:44:28+02:00">6 July 2015</span>
</span>
<span class="meta__item">Brussels</span>
</div>
</div>

<!-- Page title (mandatory) -->
<div class="ecl-page-header__title">
<h1 class=" ecl-heading ecl-heading--h1 ecl-u-color-white">Business, Economy, Euro</h1>
</div>

<!-- Page introduction (mandatory) -->
<div class="ecl-page-header__intro {{intro_class}}">
<p>EU economy, finance and the euro, and practical information for EU businesses and entrepreneurs on product safety, environmental regulations, trade with non-EU countries and competition rules.</p>
</div>
</div>
</div>
6 changes: 4 additions & 2 deletions framework/components/ecl-page-headers/default/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Page header
# Default page header

Page header default component.
Simple page header displaying page introduction.

It can be displayed with a background image by using modifier **ecl-page-header--image**.
Loading