From 510ccf01933473f57e35b5874b05a60de4269c7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20C=C3=A1mera?= Date: Wed, 20 Mar 2024 12:40:38 -0300 Subject: [PATCH 1/4] Add support to customize the path of the custom fonts --- packages/unanimo/src/unanimo.scss | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/unanimo/src/unanimo.scss b/packages/unanimo/src/unanimo.scss index c34704189..ab66f5920 100644 --- a/packages/unanimo/src/unanimo.scss +++ b/packages/unanimo/src/unanimo.scss @@ -44,6 +44,7 @@ // Font face $font-face: true, + $font-face-path: "./assets/fonts/", // Base $base-classes: true, @@ -66,17 +67,17 @@ @if $font-face == true { @font-face { font-family: SourceSansPro_Regular; // 400 - src: url("./assets/fonts/SourceSansPro_Regular.woff2"); + src: url("#{$font-face-path}SourceSansPro_Regular.woff2"); } @font-face { - font-family: SourceSansPro_SemiBold; // 700 - src: url("./assets/fonts/SourceSansPro_SemiBold.woff2"); + font-family: SourceSansPro_SemiBold; // 600 + src: url("#{$font-face-path}SourceSansPro_SemiBold.woff2"); } @font-face { font-family: SourceSansPro_Bold; // 700 - src: url("./assets/fonts/SourceSansPro_Bold.woff2"); + src: url("#{$font-face-path}SourceSansPro_Bold.woff2"); } } From 888595cf0458ad5abaf41bbe95ee6009c9650491 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20C=C3=A1mera?= Date: Wed, 20 Mar 2024 12:41:25 -0300 Subject: [PATCH 2/4] Remove unnecessary conditional check --- packages/unanimo/src/unanimo.scss | 56 +++++++++++++++---------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/packages/unanimo/src/unanimo.scss b/packages/unanimo/src/unanimo.scss index ab66f5920..47bf9220d 100644 --- a/packages/unanimo/src/unanimo.scss +++ b/packages/unanimo/src/unanimo.scss @@ -64,7 +64,7 @@ $tree-view-navigation: true ) { // font-face - @if $font-face == true { + @if $font-face { @font-face { font-family: SourceSansPro_Regular; // 400 src: url("#{$font-face-path}SourceSansPro_Regular.woff2"); @@ -82,7 +82,7 @@ } // Light - @if $light-theme == true and $colors == true and $tokens == true { + @if $light-theme and $colors and $tokens { @media (prefers-color-scheme: light) { :root { @include foundation-colors--light(); @@ -92,7 +92,7 @@ } // Dark - @if $dark-theme == true and $colors == true and $tokens == true { + @if $dark-theme and $colors and $tokens { @media (prefers-color-scheme: dark) { :root { @include foundation-colors--dark(); @@ -102,41 +102,41 @@ } :root { - @if $tokens == true { + @if $tokens { // border-radius - @if $border-radius == true { + @if $border-radius { @include border-radius(); } // box-shadow - @if $box-shadow == true { + @if $box-shadow { @include box-shadow(); } // General colors - @if $colors == true { + @if $colors { @include semantic-colors--general(); } // font-size - @if $font-size == true { + @if $font-size { @include font-size(); } // spacing - @if $spacing == true { + @if $spacing { @include spacing(); } } } // Default background-color and color - @if $tokens == true and $colors == true { + @if $tokens and $colors { body { background-color: var(--surface-un-surface--alternative); color: var(--text-un-text__on-surface--positive); - @if $font-face == true { + @if $font-face { font-family: SourceSansPro_Regular; } } @@ -145,28 +145,28 @@ // - - - - - - - - - - - - - - - - - - - - // Resets // - - - - - - - - - - - - - - - - - - - - - @if $resets == true { + @if $resets { // box-sizing - @if $box-sizing-reset == true { + @if $box-sizing-reset { @include box-sizing(); } //