From 3524f1bac11c8a9d1640bfeac5ceb063ff96d623 Mon Sep 17 00:00:00 2001 From: Volpeon Date: Sun, 6 Feb 2022 17:17:33 +0100 Subject: Improved variable structure --- src/objects/_heading.scss | 44 ++++++++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 20 deletions(-) (limited to 'src/objects/_heading.scss') diff --git a/src/objects/_heading.scss b/src/objects/_heading.scss index a0ce052..393fe14 100644 --- a/src/objects/_heading.scss +++ b/src/objects/_heading.scss @@ -1,4 +1,5 @@ @use 'iro-sass/src/index' as iro; +@use '../functions' as fn; @use '../vars'; @use '../mixins/typography'; @@ -6,61 +7,64 @@ @include iro.props-store(( --dims: ( --in-page-margin: ( - --top: iro.props-get(--dims --spacing --y --lg, $global: true), - --top-sibling: iro.props-get(--dims --spacing --y --md, $global: true), - --bottom: iro.props-get(--dims --spacing --y --sm, $global: true), + --top: fn.dim(--spacing --y --lg, $global: true), + --top-sibling: fn.dim(--spacing --y --md, $global: true), + --bottom: fn.dim(--spacing --y --sm, $global: true), ), ), + ), 'dims'); + + @include iro.props-store(( --colors: ( - --light: iro.props-get(--colors --fg-hi, $global: true), - --strong: iro.props-get(--colors --fg-lo, $global: true), + --light: fn.color(--fg-hi, $global: true), + --strong: fn.color(--fg-lo, $global: true), ), - )); + ), 'colors'); @include iro.bem-object(iro.props-namespace()) { @include typography.set-font(vars.$font--headline); display: block; - margin-top: iro.props-get(--dims --in-page-margin --top); + margin-top: fn.dim(--in-page-margin --top); margin-bottom: 0; & + & { - margin-top: iro.props-get(--dims --in-page-margin --top-sibling); + margin-top: fn.dim(--in-page-margin --top-sibling); } @include iro.bem-modifier('xxl') { - color: iro.props-get(--colors --strong); - font-size: iro.props-get(--dims --font-size --xxxl, $global: true); + color: fn.color(--strong); + font-size: fn.dim(--font-size --xxxl, $global: true); } @include iro.bem-modifier('xl') { - color: iro.props-get(--colors --strong); - font-size: iro.props-get(--dims --font-size --xxl, $global: true); + color: fn.color(--strong); + font-size: fn.dim(--font-size --xxl, $global: true); } @include iro.bem-modifier('lg') { - color: iro.props-get(--colors --strong); - font-size: iro.props-get(--dims --font-size --xl, $global: true); + color: fn.color(--strong); + font-size: fn.dim(--font-size --xl, $global: true); } @include iro.bem-modifier('md') { - color: iro.props-get(--colors --strong); - font-size: iro.props-get(--dims --font-size --lg, $global: true); + color: fn.color(--strong); + font-size: fn.dim(--font-size --lg, $global: true); } @include iro.bem-modifier('sm') { @include typography.set-font($font--main, (line-height: map-get(vars.$font--headline, line-height))); - color: iro.props-get(--colors --strong); - font-size: iro.props-get(--dims --font-size --md, $global: true); + color: fn.color(--strong); + font-size: fn.dim(--font-size --md, $global: true); font-weight: 500; } @include iro.bem-modifier('xs') { @include typography.set-font($font--main, (line-height: map-get(vars.$font--headline, line-height))); - color: iro.props-get(--colors --light); - font-size: iro.props-get(--dims --font-size --xs, $global: true); + color: fn.color(--light); + font-size: fn.dim(--font-size --xs, $global: true); font-weight: 500; text-transform: uppercase; } -- cgit v1.3.1