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

EM-1306 and EM-1309: Header Large with Background Image and with Side Image #111

Merged
merged 5 commits into from
Jun 30, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
97 changes: 86 additions & 11 deletions sass/directives/_headers.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
@include flex-direction(column);
@include justify-content(center);
@include align-items(flex-start);
position: absolute;
position: absolute; // TODO this is all specific to background image + gradients
top: 0;
left: 0;
right: 0;
width: 100%;
height: 100%;
padding-top: $base-margin;
padding-bottom: $base-margin;
padding-top: $header-padding;
padding-bottom: $header-padding;

@media only screen and (max-width: $small-screen-max) {
position: relative;
Expand Down Expand Up @@ -50,11 +50,11 @@
@mixin header-hero--home($background-image-large, $background-image-medium: nil) {
@include heading--hero;
position: relative;
min-height: $header-height-large;
min-height: $header-height-home;
overflow: hidden;
background-color: $base-background-color;
background-image: url(asset_path(#{$background-image-large}));
background-size: auto $header-height-large;
background-size: auto $header-height-home;
background-position: right bottom;
background-repeat: repeat no-repeat;

Expand Down Expand Up @@ -109,12 +109,12 @@
}
}

@mixin header--large($background-image-large, $background-image-medium: nil) {
@mixin header--large--background-image($background-image-large, $background-image-medium: nil) {
@include header-hero;
@include heading--hero;
min-height: $header-height-product;
min-height: $header-height-large;
background-image: url(asset_path(#{$background-image-large}));
background-size: auto $header-height-product;
background-size: auto $header-height-large;
background-position: right bottom;
background-repeat: repeat no-repeat;

Expand All @@ -135,14 +135,89 @@
left: 0;
@include cbGradientTransparent;
}

}

@mixin header--large--left {
@mixin header--large--side-image {
@include heading--hero;
@include cbGradient;
position: relative;
overflow: hidden;
min-height: $header-height-large;

@media only screen and (max-width: $small-screen-max) {
background-image: none;
min-height: unset;
}

&__content-wrap {
@include display(flex);
@include justify-content(space-between);
position: absolute;
top: 0;
left: 0;
right: 0;
width: 100%;
height: 100%;

@media only screen and (max-width: $small-screen-max) {
position: relative;
}
}

&__text {
@include flex-grow(1);
@include flex-shrink(1);
@include flex-basis(auto);
@include display(flex);
@include flex-direction(column);
@include justify-content(center);
@include align-items(flex-start);
margin-right: $base-spacing-medium;
padding-top: $header-padding;
padding-bottom: $header-padding;

@media only screen and (max-width: $small-screen-max) {
position: relative;
padding-top: $header-top-bottom-padding;
padding-bottom: $header-top-bottom-padding;
}

h1 {
margin-top: 0;
margin-bottom: $header-headline-bottom-margin;
line-height: normal;
color: $hero-text-color-light;

@media only screen and (max-width: $small-screen-max) {
margin-bottom: 0;
}
}

p {
margin-bottom: 0;
color: $hero-text-color-light;
}
}

.header--large__image-wrap {
@include flex-grow(1);
@include flex-shrink(0);
@include flex-basis(auto);
@include display(flex);
@include justify-content(flex-end);
@include align-items(flex-end);

@media only screen and (max-width: $small-screen-max) {
display: none;
}
}

.header--large__image {
display: block;
max-width: 34.375rem;
}
}

@mixin header--large--left {
&__text {
p {
@media only screen and (max-width: $small-screen-max) {
Expand Down
8 changes: 4 additions & 4 deletions sass/variables/_sizing.scss
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ $base-spacing-xlarge: 70px;

$section-padding: 70px;
$section-padding--mobile: 50px;
$header-padding: 70px;

$container-edge-padding: 20px; // Use this if using an unconventional body container and still need the default left /right padding our .containers have (20px)

Expand Down Expand Up @@ -68,12 +69,11 @@ $visual-guide-image-medium: 275px;
$visual-guide-image-small: 170px;

// Header
$header-height-large: 445px;
$header-height-product: 455px;
$header-height-home: 445px;
$header-height-large: 455px;
$header-top-bottom-padding: 32px;
$header-headline-bottom-margin: 15px;


$header-width-normal: 650px;

// Tables
$table-margin: $base-margin;
Expand Down