postcss-custom-properties icon indicating copy to clipboard operation
postcss-custom-properties copied to clipboard

Whitespace removed for variables followed by comma

Open dtothefp opened this issue 6 years ago • 1 comments

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

dtothefp avatar Aug 15 '19 20:08 dtothefp

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)",

ArturAntonov avatar Jan 06 '22 10:01 ArturAntonov