var.set()
The var.set() mixin defines the CSS variables based on the given $property.
@mixin set($property, $selector: (), $function: null) {
@if type-of($property) == map {
@include selector.nest-content($selector...) {
@each $name, $variant in $property {
@if type-of($variant) == map {
@each $variant-name, $value in $variant {
@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(
$function,
#{meta.call-arglist($function, $value)},
#{$value}
);
}
} @else {
#{name(combine((method: join), $name, $variant-name))}: if(
$function,
#{meta.call-arglist($function, $value)},
#{$value}
);
}
}
}
} @else {
$value: $variant;
@each $name in if(list.separator($name) == comma, $name, ($name)) {
#{name($name)}: if(
$function,
#{meta.call-arglist($function, $value)},
#{$value}
);
}
}
}
}
}
}
https://github.com/angular-package/sass/blob/main/list/_list.append.function.scss
Parameters
$property
$property The property or properties of map type to set CSS variables.
$selector
$selector Selector in which CSS variables are set.
$function
$function Function to call on property values of list type.
Examples
Last updated
Was this helpful?