Skip to content

Commit

Permalink
refactor(var.set()): add $dictionary argument to translate CSS vari…
Browse files Browse the repository at this point in the history
…able names.
  • Loading branch information
sciborrudnicki committed Sep 7, 2023
1 parent 439305e commit 99647c2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions var/mixins/_var.set.mixin.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
// Mixins.
@use '../../selector/selector.nest-content.mixin';

// Status: TODO: Use property module.
// Status: TODO: Use property module. Remove `$selector`?
// The `var.set()` mixin defines the CSS variables based on the given `$property`.
// @param `$property` The property or properties of map type to set CSS variables.
// @param `$selector` Selector in which CSS variables are set.
// @param `$function` Function to call on property values of list type.
@mixin set($property, $selector: (), $function: null) {
@mixin set($property, $selector: (), $function: null, $dictionary: ()) {
@if type-of($property) == map {
@include selector.nest-content($selector...) {
@each $name, $variant in $property {
Expand All @@ -26,14 +26,14 @@
@each $name in if(list.separator($name) == comma, $name, ($name,)) {
@if type-of($value) == map {
@each $value-name, $value in $value {
#{name(combine((method: join), $name, $variant-name, $value-name))}: if(
#{name(combine((method: join), $name, $variant-name, $value-name), $dictionary)}: if(
$function,
#{meta.call-arglist($function, $value)},
#{$value}
);
}
} @else {
#{name(combine((method: join), $name, $variant-name))}: if(
#{name(combine((method: join), $name, $variant-name), $dictionary)}: if(
$function,
#{meta.call-arglist($function, $value)},
#{$value}
Expand All @@ -44,7 +44,7 @@
} @else {
$value: $variant;
@each $name in if(list.separator($name) == comma, $name, ($name,)) {
#{name($name)}: if(
#{name($name, $dictionary)}: if(
$function,
#{meta.call-arglist($function, $value)},
#{$value}
Expand Down

0 comments on commit 99647c2

Please sign in to comment.