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

Beautify breaks fancy attribute selectors like ~= #953

Closed
ivanreese opened this issue Jul 7, 2017 · 2 comments
Closed

Beautify breaks fancy attribute selectors like ~= #953

ivanreese opened this issue Jul 7, 2017 · 2 comments
Labels
Milestone

Comments

@ivanreese
Copy link

Input CSS

I love these fancy attribute selectors!

cd-row > [col~="5th"] {
  order: 5;
}

Actual output CSS

Oh.. pumpkins! Note the spaces around the ~. In decent browsers, well, they'll just roll with the punches and ignore the spaces. But in IE11, it's a syntax error, so the entire rule is ignored.

cd-row > [col ~ ="5th"] {
  order: 5
}

Expected output CSS

Mmm that's the stuff.

cd-row > [col~="5th"] {
  order: 5
}

Configuration options

The -O level doesn't have an effect. This issue seems to entirely be the fault of the beautification. If the beautification is turned off, the output CSS is cd-row>[col~="5th"]{order:5}, which is correct.

cleancss -o clean.css styles.css -O 0 --format beautify

Environment

  • clean-css version - npm ls clean-css: 4.1.5
  • node.js version - node -v: v8.1.0
  • operating system: macOS 10.12.5
@jakubpawlowicz
Copy link
Collaborator

Yup, this is wrong. Fix is coming!

@jakubpawlowicz jakubpawlowicz added this to the 4.1.6 milestone Jul 8, 2017
jakubpawlowicz added a commit that referenced this issue Jul 8, 2017
Why:

* `~` marker can be used both to denote adjacent selectors and inside
  an attribute matcher.
jakubpawlowicz added a commit that referenced this issue Jul 8, 2017
Why:

* `~` marker can be used both to denote adjacent selectors and inside
  an attribute matcher.
@jakubpawlowicz
Copy link
Collaborator

Fixed in 4.1.6.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants