From 33f7ea6480caf7f1ba7de49f23846e3c15bf6244 Mon Sep 17 00:00:00 2001 From: Tuukka Turu <tuukka.turu@druid.fi> Date: Mon, 9 Nov 2020 14:22:47 +0200 Subject: [PATCH] Small margin calc change --- src/components/hy-hero/hy-hero.scss | 2 +- src/components/hy-hero/hy-hero.tsx | 4 ++-- src/index.html | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/hy-hero/hy-hero.scss b/src/components/hy-hero/hy-hero.scss index d6b8a16b..c1cfd09b 100644 --- a/src/components/hy-hero/hy-hero.scss +++ b/src/components/hy-hero/hy-hero.scss @@ -228,7 +228,7 @@ .hy-hero.hy-hero--common { @include breakpoint($overwide) { margin-left: -32px; - padding-left: 64px; + padding-left: 32px; } } diff --git a/src/components/hy-hero/hy-hero.tsx b/src/components/hy-hero/hy-hero.tsx index d01ce6be..3969d470 100644 --- a/src/components/hy-hero/hy-hero.tsx +++ b/src/components/hy-hero/hy-hero.tsx @@ -42,8 +42,8 @@ export class HyHero { if (!contentWrapper) return; if (document.body.scrollWidth >= 1441) { - const marginLeft = window.getComputedStyle(contentWrapper).getPropertyValue('margin-left'); - contentDiv.style.left = marginLeft !== '0px' ? marginLeft : '32px'; + const marginLeft = parseInt(window.getComputedStyle(contentWrapper).getPropertyValue('margin-left')) + 32; + contentDiv.style.left = marginLeft !== 32 ? `${marginLeft}px` : '32px'; } else { contentDiv.style.left = window.getComputedStyle(contentWrapper).getPropertyValue('padding-left'); } diff --git a/src/index.html b/src/index.html index 3967c93e..c6a12cb3 100644 --- a/src/index.html +++ b/src/index.html @@ -171,8 +171,8 @@ <hy-hero color-variant="blue" image="https://www.helsinki.fi/sites/default/files/styles/16_9_huge/public/ambassadors_toolo_4_1920x1080_original_hero_valoisampi.jpg" - heading="Congratulations to our new students" - description="University of Helsinki is ranged high in comparison with the worlds research universities." + heading="Become a part of our fantastic cheerful team" + description="Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient." url="https://www.helsinki.fi/fi/uutiset" url-title="See latest publications" sc-label="Aria label" -- GitLab