From 719e3ea1b2334e5f7817922245b66f4050b79338 Mon Sep 17 00:00:00 2001 From: Kaspar Vollenweider Date: Thu, 12 Nov 2020 15:22:59 +0100 Subject: [PATCH] fix some mistake with sass variable --- src/core/config-parser.ts | 1 + templates/scss.hbs | 21 ++++++++++++++------- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/core/config-parser.ts b/src/core/config-parser.ts index 8cb6604b..157487ac 100644 --- a/src/core/config-parser.ts +++ b/src/core/config-parser.ts @@ -23,6 +23,7 @@ const CONFIG_VALIDATORS: { formatOptions: [], pathOptions: [], codepoints: [], + customTemplate: [], fontHeight: [optional(parseNumeric)], descent: [optional(parseNumeric)], normalize: [optional(parseBoolean)], diff --git a/templates/scss.hbs b/templates/scss.hbs index 89a7ef8a..e4b58d2e 100644 --- a/templates/scss.hbs +++ b/templates/scss.hbs @@ -40,7 +40,10 @@ ${{ nameKebab }}-prefix: '{{ prefix }}'; ) { $srcs: ''; @each $format in $types { - $srcs: "#{$srcs}, url('#{$path}/#{$filename}.#{$format}') format('#{$format}')" + $srcs: "#{$srcs}url('#{$path}/#{$filename}.#{$format}') format('#{$format}')"; + @if index($types, $format) < length($types) { + $srcs: "#{$srcs}, "; + } } @return $srcs; } @@ -68,7 +71,11 @@ ${{ nameKebab }}-prefix: '{{ prefix }}'; } // Allows making any css declaration do an icon -@mixin {{ nameKebab }}-before($code-point-key: '', $size: '') { +@mixin {{ nameKebab }}-before( + $codeid: '', + $size: '', + $codepoints: ${{ nameKebab }}-codepoints +) { @if $size != '' { font-size: $size; } @@ -84,8 +91,8 @@ ${{ nameKebab }}-prefix: '{{ prefix }}'; @if $size != '' { font-size: $size; } - @if $code-point-key != '' { - @include codepoint-content($codeid: $code-point-key, $codepoints: ${{ nameKebab }}-codepoints); + @if $codeid != '' { + @include codepoint-content($codeid: $codeid, $codepoints: $codepoints); } } } @@ -106,10 +113,10 @@ ${{ nameKebab }}-prefix: '{{ prefix }}'; @include {{ nameKebab }}-before; } - @each $key, $codepoint in $codepoints { + @each $codeid, $codepoint in $codepoints { &#{$prefix} { - &-#{$key}::before { - @include codepoint-content($codeid: $code-point-key, $codepoints: $codepoints); + &-#{$codeid}::before { + @include codepoint-content($codeid: $codeid, $codepoints: $codepoints); } } }