angular-package
PatreonTwitternpmGitHub
Sass
Sass
  • Introduction
  • ❤ Benefits
  • General concepts
  • Getting started
    • Skeleton
    • Installation
      • npm
    • Public API
    • Basic concepts
  • Class
    • Overview
    • ⚒ class.content()
    • ⚒ class.name()
    • ⚒ class.parent-first()
    • ⚒ variables
  • Color
    • Overview
    • Scheme
      • is
        • ⚒ is.dark()
        • ⚒ is.light()
        • ⚒ is.normal()
      • ⚒ scheme.is()
    • ⚒ color.alpha-var()
    • ⚒ color.color()
    • ⚒ color.hsla-color()
    • ⚒ color.hue-var()
    • ⚒ color.lightness-var()
    • ⚒ color.name()
    • ⚒ color.retrieve()
    • ⚒ color.saturation-var()
  • Comparison
    • Overview
    • Greater
      • greater.than()
      • greater.than-any()
      • greater.than-every()
    • Less
      • less.than()
      • less.than-any()
      • less.than-every()
    • comparison.compare()
    • comparison.compare-multiple()
  • Function
    • Overview
    • Call
      • ⚒ function.arglist()
      • ⚒ function.by-list()
    • ⚒ function.call()
    • ⚒ function.get()
    • ⚒ function.has()
    • ⚒ function.insert()
    • ⚒ function.is()
    • ⚒ function.name()
    • ⚒ function.pick()
    • ⚒ function.prefix()
    • ⚒ function.remove()
  • List
    • Overview
    • Get
      • get.bool()
      • get.list()
      • get.map()
      • get.number()
      • get.string()
      • get.type()
    • Has
      • has.bool()
      • has.list()
      • has.map()
      • has.number()
      • has.string()
      • has.type()
      • has.value()
    • Remove
      • remove.duplicate()
      • remove.list()
      • remove.map()
      • remove.nth()
      • remove.number()
      • remove.range()
      • remove.string()
      • remove.type()
      • remove.value()
    • list.append()
    • list.empty()
    • list.extract-map()
    • list.first()
    • list.from()
    • list.has()
    • list.index()
    • list.indexes()
    • list.insert-nth()
    • list.join()
    • list.last()
    • list.limit()
    • list.nth()
    • list.range()
    • ⚒ list.replace-string()
    • ⚒ list.replace()
    • list.select()
    • ⚒ list.swap()
    • ⚒ list.to-map()
    • list.to()
    • list.type()
  • Map
    • Overview
    • Pattern
      • pattern.is()
      • Variables
    • Pick
      • pick.key-substring()
      • pick.key-type()
      • pick.pattern()
      • pick.type()
      • pick.value-type()
    • map.deep-merge-key()
    • map.deep-merge()
    • map.get()
    • map.has-keys()
    • map.key-replace()
    • ⚒ map.merge-allowed()
    • map.pick()
    • map.remove-type()
    • map.remove()
    • map.retrieve()
    • map.set()
    • map.update()
    • map.values()
  • Math
    • Overview
    • Range
      • range.down()
      • range.up()
    • math.calculate()
    • math.range()
    • ⚒ math.sort()
    • math.strip-unit()
  • Meta
    • Overview
    • ⚒ meta.call-arglist()
    • ⚒ meta.of-type()
  • Object
    • Overview
    • ⚒ object.create()
    • ⚒ object.get()
    • ⚒ object.set()
  • Property
    • Overview
    • ⚒ property.property()
    • ⚒ property.name()
    • ⚒ property.set()
    • ⚒ property.value()
    • ⚒ property.variant()
  • Query
    • Overview
    • Operation
      • ⚒ operation.execute()
    • ⚒ query.execute()
  • Selector
    • Overview
    • ⚒ selector.class()
    • ⚒ selector.nest-content()
    • ⚒ selector.nest()
    • ⚒ selector.pseudo-class()
    • ⚒ selector.replace-parent()
  • String
    • Overview
    • string.index()
    • string.join()
    • string.replace-multiple()
    • string.replace()
    • string.split()
    • ⚒ string.to-map()
    • ⚒ string.unquote()
  • Translator v0.1.0
    • Overview
    • Dictionary
      • dictionary.get()
      • dictionary.is-global()
      • dictionary.merge()
      • dictionary.pick()
      • dictionary.set()
      • dictionary.translation()
      • dictionary.variables
    • Translate
      • translate.list()
      • translate.map()
      • translate.nth()
      • translate.string()
    • translator.dictionary()
    • translator.translate()
  • Translator v1.0.0
    • Overview
    • Dictionary
      • dictionary.get()
      • dictionary.merge()
      • dictionary.pick()
      • dictionary.set()
      • dictionary.translation()
      • dictionary.variables
    • ⚒ Translate
    • translator.dictionary()
    • translator.translate()
  • Values
    • Overview
    • values.combine()
  • Var
    • Overview
    • ⚒ var.adjust()
    • ⚒ var.css()
    • ⚒ var.get()
    • ⚒ var.is()
    • ⚒ var.name()
    • ⚒ var.negative()
    • ⚒ var.unit()
    • var.set()
  • Variant
    • Overview
  • Change log
    • Keep a changelog
    • CHANGELOG.md
    • v0.12.0-beta
  • GIT
    • Commit
    • Semantic Versioning
  • License
    • MIT
  • Social
    • Gettr
    • Twitter
    • YouTube
  • Contact
    • Chat
    • Email
    • Phone
  • Donate
    • Cryptocurrency
    • Fiat
Powered by GitBook
On this page
  • Parameters
  • Examples

Was this helpful?

  1. Var

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}
            );
          }
        }
      }
    }
  }
}

Parameters

$property

The property or properties of map type to set CSS variables.

$selector

Selector in which CSS variables are set.

$function

Function to call on property values of list type.

Examples

// Use.
@use 'angular-package/sass/var';

// Examples.

Previous⚒ var.unit()NextOverview

Last updated 1 year ago

Was this helpful?

https://github.com/angular-package/sass/blob/main/list/_list.append.function.scss
// Sass.
@use 'sass:list';

// Status: DONE
// The modified `list.append()` function returns a copy of `$list` with `$val` and/or with added multiple `$values`.
// The function is modified by adding arbitrary values to the end of the parameters to preserve the original functionality.
// @param `$list` The list to append the `$val` and/or `$values` into.
// @param `$val` The value to append to the end of `$list`.
// @param `$separator` The separator `comma`, `space` or `slash` of the list. Default `auto`.
// @arbitrary `$values...` Additional values to append into `$list`.
// @return Returns a copy of `$list` with `$val` and/or `$values` added to the end.
@function append($list, $val, $separator: auto, $values...) {
  @each $value in list.join(($val,), $values, comma) {
    $list: list.append($list, $value, $separator);
  }
  @return $list;
}

// Examples.
// @debug append(10px 20px, 30px); // 10px 20px 30px
// @debug append((red, green), blue, space); // red green blue

// additional values
// @debug append((blue, red), green, auto, blue, red); // blue, red, green, blue, red
// @debug append(10px 20px, 30px 40px, auto, 1px, 15px); // 10px 20px (30px 40px) 1px 15px
// @debug append(10px, 20px, auto, 1em, 2rem); // 10px 20px 1em 2rem
// @debug append(10px 20px, 30px 40px, auto, 1px, 15px, (1px 2px 3px)); // 10px 20px (30px 40px) 1px 15px (1px 2px 3px)
// @debug append((10px, 20px), 30px 40px, auto, 1px, 15px, (1px 2px 3px), (4px, 5px)); // 10px, 20px, 30px 40px, 1px, 15px, 1px 2px 3px, (4px, 5px)

// append map
// @debug append(1 2 3, (a: 1, b: 2, c: 3), auto, (d: 4, e: 5)); // 1 2 3 (a: 1, b: 2, c: 3) (d: 4, e: 5)
// @debug append((a: 1, b: 2), (c: 3, d: 4), auto, (e: 5, f: 6)); // a 1, b 2, (c: 3, d: 4), (e: 5, f: 6)
// @debug append(1 2 3, (a: 1, b: 2, c: 3), auto, (d: 4, e: 5), (4, 5, 6), (7, 8, 9)); // 1 2 3 (a: 1, b: 2, c: 3) (d: 4, e: 5) (4, 5, 6) (7, 8, 9)
// @debug append(1 2 3, (a: 1, b: 2, c: 3), auto, (d: 4, e: 5), 4, 5, 6, 7, 8, 9); // 1 2 3 (a: 1, b: 2, c: 3) (d: 4, e: 5) 4 5 6 7 8 9