postcss / postcss-custom-properties

Use Custom Properties in CSS
https://postcss.github.io/postcss-custom-properties
MIT License
596 stars 77 forks source link

Whitespace removed for variables followed by comma #193

Open dtothefp opened 5 years ago

dtothefp commented 5 years ago

When using variables for a CSS transition followed by a comma white space is removed between the transition properties which breaks the transition:

ex.

// pre-compiled.css
:root {
  --transition-transform: transform 0.3s ease-out;
}

.bg {
  transition: var(--transition-transform), visibility 0.3s ease-out;
}
// compiled css
:root {
  --transition-transform: transform 0.3s ease-out;
}

.bg {
  transition: transform0.3sease-out, visibility 0.3s ease-out;
  transition: var(--transition-transform), visibility 0.3s ease-out;
}

If a whitespace is added to the comma following the property the whitespace will be preserved

// pre-compiled.css
:root {
  --transition-transform: transform 0.3s ease-out;
}

.bg {
  transition: var(--transition-transform) , visibility 0.3s ease-out;
}
// compiled css
:root {
  --transition-transform: transform 0.3s ease-out;
}

.bg {
  transition: transform 0.3s ease-out , visibility 0.3s ease-out;
  transition: var(--transition-transform) , visibility 0.3s ease-out;
}
ArturAntonov commented 2 years ago

Have the same error From this :root { --input-border-bottom-idle: inset 0 -1px 0 0 var(--c-primary-light); } I get this incorrect style "--input-border-bottom-idle": "inset,0,-1px,0,0,var(--c-primary-light)",