postcss / postcss-custom-properties

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

Comma-separated font-family declaration split onto multiple lines #221

Closed MoltenCoffee closed 3 years ago

MoltenCoffee commented 4 years ago

Hi there! I'm encountering a weird issue that I cannot really pinpoint.

The setup is as follows:

:root {
  --fontMain: "Open Sans", sans-serif;
}

body {
  font-family: var(--fontMain);
}

After running PostCSS (for which I have gulp setup, I run PostCSS-custom-properties with default settings), the resulting CSS is this:

:root {
  --fontMain:"Open Sans",sans-serif;
}
/* Notice the weird spacing of the first font-family property in body: */
body {
  font-family:"Open Sans"
,
sans-serif;
  font-family:var(--fontMain);
}

I believe this should work in the browser, and a minifier further down the line will probably solve it, but this seems weird behaviour to me. Any idea what causes this? Disabling all other postCSS plugins yields the same result.

Semigradsky commented 3 years ago

Fixed in https://github.com/postcss/postcss-custom-properties/releases/tag/9.2.0