From 05a11af8d226f4b7c86eb6f3a460e0da853efaab Mon Sep 17 00:00:00 2001 From: Kirsten Roschanski Date: Fri, 8 Jan 2021 12:16:09 +0100 Subject: [PATCH 1/2] Update _type.scss Set font-weight and font-family standalone from theme --- files/nutshell/scss/base/_type.scss | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/files/nutshell/scss/base/_type.scss b/files/nutshell/scss/base/_type.scss index fa37ef5..aec7c29 100644 --- a/files/nutshell/scss/base/_type.scss +++ b/files/nutshell/scss/base/_type.scss @@ -136,14 +136,27 @@ html { $line-height: map-get($options, line-height); $margin-top: map-get($options, margin-top); $margin-bottom: map-get($options, margin-bottom); + $font-weight: map-get($options, font-weight); + $font-family: map-get($options, font-family); font-size: map-get($sizes, xs); // [5] - font-family: var(--headings__font-family); - font-weight: var(--headings__font-weight); line-height: $line-height; margin-bottom: $margin-bottom; - + + + @if $font-weight { + font-weight: $font-weight; + } @else { + font-weight: var(--headings__font-weight); + } + + @if $font-family { + font-family: $font-family; + } @else { + font-family: var(--headings__font-family); + } + // [6] @for $i from 2 through length($sizes) { $current: nth($sizes, $i); // $i = 2 = sm, $i = 5 = xl From fc49b9ffcb2c7e046f836e1923fe652eb9153917 Mon Sep 17 00:00:00 2001 From: Dennis Erdmann Date: Sun, 14 Mar 2021 14:25:54 +0100 Subject: [PATCH 2/2] clean up --- files/nutshell/scss/base/_type.scss | 48 ++++++++++++++--------------- 1 file changed, 23 insertions(+), 25 deletions(-) diff --git a/files/nutshell/scss/base/_type.scss b/files/nutshell/scss/base/_type.scss index 9812c02..68faa58 100644 --- a/files/nutshell/scss/base/_type.scss +++ b/files/nutshell/scss/base/_type.scss @@ -90,23 +90,22 @@ $headlines: ( html { --headings__font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Helvetica Neue", Arial, sans-serif; --headings__font-weight: 700; - --headings__color: 'currentColor'; + --headings__color: 'currentColor'; - --paragraph__link-color: var(--color-links); - --code__color: var(--color-highlight); - --selection-background: var(--color-brand); - --pre__color-background: var(--color-gray); - --pre__color: var(--color-text--inverted); + --paragraph__link-color: var(--color-links); + --code__color: var(--color-highlight); + --selection-background: var(--color-brand); + --pre__color-background: var(--color-gray); + --pre__color: var(--color-text--inverted); - --selection-color: var(--color-text--inverted); + --selection-color: var(--color-text--inverted); - --hr-border: var(--base-border); - --paragraph__link-decoration: underline; - --paragraph__link-decoration--hover: none; + --hr-border: var(--base-border); + --paragraph__link-decoration: underline; + --paragraph__link-decoration--hover: none; } - // USED FROM _variables.scss // -------------------------------------------------- @@ -142,32 +141,32 @@ html { font-size: map-get($sizes, xs); // [5] line-height: $line-height; margin-bottom: $margin-bottom; - + @if $color { color: $color; } - + @if $font-weight { font-weight: $font-weight; } @else { font-weight: var(--headings__font-weight); - } - + } + @if $font-family { font-family: $font-family; } @else { font-family: var(--headings__font-family); - } - + } + // [6] @for $i from 2 through length($sizes) { - $current: nth($sizes, $i); // $i = 2 = sm, $i = 5 = xl - $viewport: nth($current, 1); - $font-size: nth($current, 2); + $current: nth($sizes, $i); // $i = 2 = sm, $i = 5 = xl + $viewport: nth($current, 1); + $font-size: nth($current, 2); - @include media-query(screen-#{$viewport}) { - font-size: $font-size; - } + @include media-query(screen-#{$viewport}) { + font-size: $font-size; + } } } @@ -185,7 +184,6 @@ html { margin-top: $margin-top; } - .ce_text + .ce_text & { &:first-child { margin-top: $margin-top; @@ -248,7 +246,7 @@ hr { } ::selection { - background: var(--selection-background); + background: var(--selection-background); color: var(--selection-color); opacity: 1; }