postcss-advanced-variables icon indicating copy to clipboard operation
postcss-advanced-variables copied to clipboard

Allow for CSS variables to be used with mixins

Open kmonahan opened this issue 1 year ago • 0 comments

Fixes #78 . Allows for CSS variables to be set as the default value for a mixin or passed as a parameter.

Example:

@mixin set-color($color: var(--text-color)) {
  color: $color;
}

h3 {
  @include set-color;
}

h4 {
  @include set-color(var(--my-color));
}

Before, that resulted in:

h3 {
  color: va;
}

h4 {
  color: va;
}

After, that results in:

h3 {
  color: var(--text-color);
}

h4 {
  color: var(--my-color);
}

kmonahan avatar Feb 27 '23 23:02 kmonahan