Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Comma separated rules are unnecessarily expanded (duplicate blocks) #58

Open
amustill opened this issue Aug 15, 2017 · 4 comments
Open

Comments

@amustill
Copy link

It appears that comma-separated rules are expanded even if the variable value is the same, creating additional unnecessary rules.

Input:

:root {
    --font-family: sans-serif;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-family);
}

Expected output:

h1, h2, h3, h4, h5, h6 {
    font-family: sans-serif;
}

Actual output:

h1 {
    font-family: sans-serif;
}

h2 {
    font-family: sans-serif;
}

h3 {
    font-family: sans-serif;
}

h4 {
    font-family: sans-serif;
}

h5 {
    font-family: sans-serif;
}

h6 {
    font-family: sans-serif;
}
@jfbrennan
Copy link

enhancement? that output should be consider a bug and fixed. is this being worked on any time soon? would like to use this plugin but that extra bloat isn't worth refactoring from Less vars...

@MadLittleMods
Copy link
Owner

@jfbrennan The effective output is the same whether expanded or comma-separated so it isn't a bug. I have no plans to work on this issue but happy to review a PR

@jfbrennan
Copy link

@MadLittleMods thanks for the quick reply.

FYI anyone concerned about the unexpected output (this significantly increases the size of your stylesheet) the cousin plugin https://github.com/postcss/postcss-custom-properties does not have this issue.

@MadLittleMods
Copy link
Owner

@MadLittleMods MadLittleMods changed the title Comma separated rules are unnecessarily expanded Comma separated rules are unnecessarily expanded (duplicate blocks) Nov 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants