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

CSS selectors compiled wrong #60

Closed
krisdigital opened this issue Jan 29, 2016 · 10 comments
Closed

CSS selectors compiled wrong #60

krisdigital opened this issue Jan 29, 2016 · 10 comments

Comments

@krisdigital
Copy link

When updating to the newest Rails version 4.2.5.1, sassc (1.8.4) and sassc-rails (1.2.0) were also updated. Suddenly Bootstrap is compiled with strange errors. For example input-groups:

.input-group .form-control:not(:first-child, :first-child, :first-child):not(:last-child, :last-child, :last-child)

The :first-child and :last-child statements should obviously only appear once and let the statement break in Chrome and Firefox. Switching back to sass-rails solves the error.

Any idea what change caused this?

@krisdigital krisdigital changed the title SCSS compiled wrong CSS compiled wrong Jan 29, 2016
@krisdigital krisdigital changed the title CSS compiled wrong CSS selectors compiled wrong Jan 29, 2016
@bolandrm
Copy link
Member

Try sassc-ruby 1.8.3. This may be a bug in the latest version of libsass.

@krisdigital
Copy link
Author

@bolandrm Thank's for the suggestion. Just tried it and does not make a difference!

@dsteppeler
Copy link

Hi!
I am interested in a fix for this as well. Currently it is preventing me from using this gem.
It seems to be related to this one: sass/libsass#1901

Regards!

@samjewell
Copy link
Contributor

I'd also love a fix for this.
We saw it around checkboxes and radio buttons

:not(:checked)

was compiled to

:not(:checked, :checked)

@bolandrm
Copy link
Member

I've just released sassc 1.8.5 which upgrades libsass to 3.3.4. Please give that a try!

@ElManouche
Copy link

I've now sassc 1.9.0, but the same issue.
Any other suggestions?

@ElManouche
Copy link

I have more details after some tests.
The error only appears when the parent selector has a period as well:

.test {
  // this works
  .test__elem {
    &:not(.active) {
      opacity: 0.5;
    }
  }

  // this creates a bug in the 'not' selector
  .test__item,
  .test__item2 {
    &:not(.active) {
      opacity: 0.5;
    }
  }
}

is compiled to:

.test .test__elem:not(.active) {
  opacity: 0.5;
}

.test .test__item:not(.active, .active),
.test .test__item2:not(.active, .active) {
  opacity: 0.5;
}

[EDIT]: I opened a bug in libsass

@bolandrm
Copy link
Member

@ElManouche could you please post this bug here: https://github.com/sass/libsass/issues and link your issue back to this thread so we can track it?

@xzyfer
Copy link

xzyfer commented Mar 31, 2016

@bolandrm this is fixed in 3.3.4.

@bolandrm
Copy link
Member

@xzyfer i thought so... sassc 1.8.5 / 1.9.0 are using libsass 3.3.4, so this should be fixed.

@bolandrm bolandrm closed this as completed Apr 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants