# var.set()

The `var.set()` mixin defines the CSS variables based on the given `$property`.

{% code lineNumbers="true" %}

```scss
@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}
            );
          }
        }
      }
    }
  }
}

```

{% endcode %}

{% embed url="<https://github.com/angular-package/sass/blob/main/list/_list.append.function.scss>" %}

### Parameters

#### **`$property`**&#x20;

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

#### **`$selector`**&#x20;

Selector in which CSS variables are set.

#### **`$function`**&#x20;

Function to call on property values of list type.

## Examples

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

// Examples.


```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.angular-package.dev/sass/var/var.set.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
