csstools/postcss-color-mod-function

Duplicate Properties When Variables Used

jherdman opened this issue · 2 comments

Given:

:root {
  --c-reg: rgb(255, 55, 1);
}

.mySelector {
  background-color: color-mod(var(--c-red) lightness(20%));
}

Expected:

/* I'm assuming the math this plugin is doing is correct... */

.mySelector {
  background-color: background-color: hsl(12.755905511811026, 100%, 20%);
}

Actual:

.mySelector {
  background-color: background-color: hsl(12.755905511811026, 100%, 20%);
  background-color: background-color: hsl(12.755905511811026, 100%, 20%);
}

Interestingly I sometimes see...

.myOtherSelector {
  color: rgb(255, 55, 1);
  color: var(--c-red);
}

Closing. My apologies, this is the result of postcss-custom-properties.