Skip to content
This repository has been archived by the owner on Jan 4, 2025. It is now read-only.

Commit

Permalink
fix some mistake with sass variable
Browse files Browse the repository at this point in the history
  • Loading branch information
casaper committed Nov 12, 2020
1 parent 21714a5 commit 719e3ea
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
1 change: 1 addition & 0 deletions src/core/config-parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const CONFIG_VALIDATORS: {
formatOptions: [],
pathOptions: [],
codepoints: [],
customTemplate: [],
fontHeight: [optional(parseNumeric)],
descent: [optional(parseNumeric)],
normalize: [optional(parseBoolean)],
Expand Down
21 changes: 14 additions & 7 deletions templates/scss.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand All @@ -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);
}
}
}
Expand All @@ -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);
}
}
}
Expand Down

0 comments on commit 719e3ea

Please sign in to comment.