Skip to content
Snippets Groups Projects
Commit 6c1e409c authored by Ekaterina Kondareva's avatar Ekaterina Kondareva Committed by Tuukka Turu
Browse files

Nxstage 617 intro sprint18

parent f0b59ad5
No related branches found
No related tags found
No related merge requests found
...@@ -196,6 +196,7 @@ export namespace Components { ...@@ -196,6 +196,7 @@ export namespace Components {
} }
interface HyGridRow {} interface HyGridRow {}
interface HyHeading { interface HyHeading {
headerstyle: string;
/** /**
* @type {*} * @type {*}
*/ */
...@@ -929,6 +930,7 @@ declare namespace LocalJSX { ...@@ -929,6 +930,7 @@ declare namespace LocalJSX {
} }
interface HyGridRow {} interface HyGridRow {}
interface HyHeading { interface HyHeading {
headerstyle?: string;
/** /**
* @type {*} * @type {*}
*/ */
......
...@@ -101,17 +101,45 @@ h2.hy-heading__landingsection { ...@@ -101,17 +101,45 @@ h2.hy-heading__landingsection {
@include font-size(40px, 40px); @include font-size(40px, 40px);
letter-spacing: -1.25px; letter-spacing: -1.25px;
} }
}
@include breakpoint($extrawide) { // Applied when there is a sidebar
// > 1200px .hy-heading__container__common {
@include font-size(48px, 48px); h2.hy-heading__introduction,
letter-spacing: -1.6px; h2.hy-heading__landingsection {
@include breakpoint($extrawide) {
// > 1200px
// ex. Side menu layout on Mid-sized desktop; Medium font
@include font-size(40px, 40px);
letter-spacing: -1.25px;
}
@include breakpoint($overwide) {
// > 1400px
// ex. Side menu layout on Large desktop; Large font
@include font-size(48px, 48px);
letter-spacing: -1.6px;
}
} }
}
@include breakpoint($overwide) { // Applied when there is NO sidebar
// > 1400px .hy-heading__container__large {
@include font-size(54px, 54px); h2.hy-heading__introduction,
letter-spacing: -1.8px; h2.hy-heading__landingsection {
@include breakpoint($extrawide) {
// > 1200px
// ex. Full width layout on Mid-sized desktop; Large font
@include font-size(48px, 48px);
letter-spacing: -1.6px;
}
@include breakpoint($overwide) {
// > 1400px
// ex. Full width layout on Large desktop; X-large font
@include font-size(54px, 54px);
letter-spacing: -1.8px;
}
} }
} }
......
import {Component, Prop, Host, h} from '@stencil/core'; import {Component, Element, Prop, Host, h} from '@stencil/core';
import {HeadingVarians, HeadingSectionVariants} from '../../utils/utils'; import {HeadingVarians, HeadingSectionVariants} from '../../utils/utils';
@Component({ @Component({
...@@ -17,6 +17,17 @@ export class Heading { ...@@ -17,6 +17,17 @@ export class Heading {
*/ */
@Prop() section: HeadingSectionVariants = HeadingSectionVariants.default as any; @Prop() section: HeadingSectionVariants = HeadingSectionVariants.default as any;
@Prop() negative: boolean = false; @Prop() negative: boolean = false;
@Prop() headerstyle: string = 'common';
@Element() el: HTMLElement;
componentDidLoad() {
let hyMainDiv = this.el.closest('.hy-main');
if (hyMainDiv) {
if (!hyMainDiv.classList.contains('with-sidebar')) {
this.headerstyle = 'large';
}
}
}
render() { render() {
const headingInVariants = this.heading in HeadingVarians; const headingInVariants = this.heading in HeadingVarians;
...@@ -24,7 +35,12 @@ export class Heading { ...@@ -24,7 +35,12 @@ export class Heading {
const sectionClassAttributes = [`hy-heading__${this.section}--divider`].join(' '); const sectionClassAttributes = [`hy-heading__${this.section}--divider`].join(' ');
const containerSectionClass = ['hy-heading__container', `hy-heading__container__${this.section}`].join(' '); const containerSectionClass = [
'hy-heading__container',
`hy-heading__container__${this.section}`,
`hy-heading__container__${this.headerstyle}`,
].join(' ');
return ( return (
<Host> <Host>
{headingInVariants ? ( {headingInVariants ? (
......
...@@ -87,11 +87,12 @@ Provide heading attribute for the component to choose what type of heading to us ...@@ -87,11 +87,12 @@ Provide heading attribute for the component to choose what type of heading to us
## Properties ## Properties
| Property | Attribute | Description | Type | Default | | Property | Attribute | Description | Type | Default |
| ---------- | ---------- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------- | | ------------- | ------------- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------- |
| `heading` | `heading` | | `HeadingVarians.default \| HeadingVarians.h2 \| HeadingVarians.h3 \| HeadingVarians.h4 \| HeadingVarians.h5 \| HeadingVarians.h6` | `HeadingVarians.default as any` | | `headerstyle` | `headerstyle` | | `string` | `"normal"` |
| `negative` | `negative` | | `boolean` | `false` | | `heading` | `heading` | | `HeadingVarians.default \| HeadingVarians.h2 \| HeadingVarians.h3 \| HeadingVarians.h4 \| HeadingVarians.h5 \| HeadingVarians.h6` | `HeadingVarians.default as any` |
| `section` | `section` | | `HeadingSectionVariants.contentPageHeader \| HeadingSectionVariants.default \| HeadingSectionVariants.introduction \| HeadingSectionVariants.landingPageHeader \| HeadingSectionVariants.subSection` | `HeadingSectionVariants.default as any` | | `negative` | `negative` | | `boolean` | `false` |
| `section` | `section` | | `HeadingSectionVariants.contentPageHeader \| HeadingSectionVariants.default \| HeadingSectionVariants.introduction \| HeadingSectionVariants.landingPageHeader \| HeadingSectionVariants.subSection` | `HeadingSectionVariants.default as any` |
## Dependencies ## Dependencies
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
@include breakpoint($narrow) { @include breakpoint($narrow) {
box-shadow: 10px -10px 20px -10px rgba(14, 104, 139, 0.1); box-shadow: 10px -10px 20px -10px rgba(14, 104, 139, 0.1);
margin-top: -83px; margin-top: -40px;
padding: 0 32px 0 0; padding: 0 32px 0 0;
width: 90%; width: 90%;
} }
...@@ -34,7 +34,9 @@ ...@@ -34,7 +34,9 @@
@include breakpoint($wide) { @include breakpoint($wide) {
box-shadow: none; box-shadow: none;
margin-top: 0; margin-top: 0;
padding: 0 32px 0 0; //padding: 0 32px 0 0;
padding: 0 5.52% 0 0;
width: 48.75%;
} }
} }
...@@ -46,7 +48,7 @@ ...@@ -46,7 +48,7 @@
@include breakpoint($narrow) { @include breakpoint($narrow) {
box-shadow: -10px -10px 20px -10px rgba(14, 104, 139, 0.1); box-shadow: -10px -10px 20px -10px rgba(14, 104, 139, 0.1);
margin-top: -83px; margin-top: -40px;
padding: 0 0 0 32px; padding: 0 0 0 32px;
width: 90%; width: 90%;
} }
...@@ -54,7 +56,9 @@ ...@@ -54,7 +56,9 @@
@include breakpoint($wide) { @include breakpoint($wide) {
box-shadow: none; box-shadow: none;
margin-top: 0; margin-top: 0;
padding: 0 0 0 32px; //padding: 0 0 0 32px;
padding: 0 0 0 5.52%;
width: 48.75%;
} }
} }
} }
...@@ -95,11 +99,14 @@ ...@@ -95,11 +99,14 @@
} }
.hy-introduction__link { .hy-introduction__link {
background: var(--grayscale-white); //background: var(--grayscale-white);
color: var(--brand-main-light); background: var(--brand-main-active);
//color: var(--brand-main-light);
color: var(--grayscale-white);
&__icon svg { &__icon svg {
fill: var(--brand-main-light); //fill: var(--brand-main-light);
fill: var(--grayscale-white);
} }
} }
} }
...@@ -125,8 +132,12 @@ ...@@ -125,8 +132,12 @@
} }
.hy-introduction__link { .hy-introduction__link {
background: var(--grayscale-black); background: var(--brand-main-light);
color: var(--grayscale-white); color: var(--grayscale-white);
&__icon svg {
fill: var(--grayscale-white);
}
} }
} }
} }
...@@ -148,28 +159,37 @@ ...@@ -148,28 +159,37 @@
width: 100%; width: 100%;
@include breakpoint($wide) { @include breakpoint($wide) {
width: calc(100% / 12 * 10 - var(--gutter-medium)); width: 91.46%;
}
@include breakpoint($extrawide) {
width: 82.89%;
}
@include breakpoint($overwide) {
width: 74.2%;
} }
} }
&__content--with-image { &__content--with-image {
margin-left: -16px; margin-left: -16px;
margin-top: -60px; margin-top: -64px;
padding: 60px 16px 32px; padding: 64px 16px 40px;
width: calc(100% + 32px); width: calc(100% + 32px);
@include breakpoint($narrow) { @include breakpoint($narrow) {
margin-left: -32px; margin-left: -32px;
padding: 60px 32px 32px; margin-top: -120px;
padding: 120px 32px 48px;
width: calc(100% + 64px); width: calc(100% + 64px);
} }
@include breakpoint($wide) { @include breakpoint($wide) {
margin: 0; margin: 0;
padding: 0; padding: 0;
width: calc(100% / 12 * 6); //width: calc(100% / 12 * 6);
width: 45.73%;
} }
} }
&__title { &__title {
.hy-heading__container { .hy-heading__container {
@include breakpoint($wide) { @include breakpoint($wide) {
...@@ -182,12 +202,18 @@ ...@@ -182,12 +202,18 @@
width: 100%; width: 100%;
@include breakpoint($wide) { @include breakpoint($wide) {
width: calc(100% / 12 * 5 - var(--gutter-medium)); //width: calc(100% / 12 * 5 - var(--gutter-medium));
width: 45.73%;
} }
.hy-image, .hy-image,
.hy-image .hy-image__image-container { .hy-image .hy-image__image-container {
height: 100% !important; height: 100% !important;
--aspectRatio: 66.5% !important;
@include breakpoint($wide) {
--aspectRatio: 71.42857142857143% !important;
}
} }
} }
...@@ -212,7 +238,8 @@ ...@@ -212,7 +238,8 @@
} }
&__link { &__link {
@include font-size(18px); @include font-size(16px, 20px);
letter-spacing: -0.5px;
background-color: var(--brand-main-light); background-color: var(--brand-main-light);
border: 2px solid var(--grayscale-white); border: 2px solid var(--grayscale-white);
...@@ -222,14 +249,26 @@ ...@@ -222,14 +249,26 @@
cursor: pointer; cursor: pointer;
display: inline-block; display: inline-block;
font-family: var(--main-font-family); font-family: var(--main-font-family);
font-weight: 600; font-weight: 700;
height: 100%; height: 100%;
padding: 16px 70px 16px 19px; padding: 12px 60px 12px 12px;
position: relative; position: relative;
text-decoration: none; text-decoration: none;
@include breakpoint($narrow) {
@include font-size(16px, 20px);
letter-spacing: -0.6px;
padding: 14px 62px 14px 16px;
}
@include breakpoint($wide) { @include breakpoint($wide) {
@include font-size(18px); @include font-size(18px, 20px);
}
@include breakpoint($extrawide) {
@include font-size(20px, 20px);
letter-spacing: -0.7px;
padding: 16px 70px 16px 18px;
} }
&__icon { &__icon {
......
...@@ -58,7 +58,7 @@ export class HyIntroduction { ...@@ -58,7 +58,7 @@ export class HyIntroduction {
</div> </div>
{this.imageUrl && ( {this.imageUrl && (
<div class="hy-introduction__image"> <div class="hy-introduction__image">
<hy-image image-url={this.imageUrl} aspectRatioWidth={3} aspectRatioHeight={2} /> <hy-image image-url={this.imageUrl} aspectRatioWidth={7} aspectRatioHeight={5} />
</div> </div>
)} )}
</div> </div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment