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

Multiple selector with ampersand in Sass 3.3.8 #1277

Closed
hinok opened this issue Jun 10, 2014 · 4 comments
Closed

Multiple selector with ampersand in Sass 3.3.8 #1277

hinok opened this issue Jun 10, 2014 · 4 comments

Comments

@hinok
Copy link

hinok commented Jun 10, 2014

Just upgraded from 3.3.0.rc.2 to 3.3.8 and unfortunately some of our styles don't compile anymore.

We have the problem with styles like:

.list {
    @at-root {
        #{&}--big#{&}--active {
            color: red;
        }
    }
}

I know that since final release 3.3.0 we can write styles without @at-root and just use & instead #{&}. Anyway after changes constructions like below don't compile.

.list {
    &--big&--active {
        color: red;
    }
}

Codepen demo: http://codepen.io/anon/pen/lJfHw

@Snugug
Copy link

Snugug commented Jun 10, 2014

There was a change in how these selectors work for the full release of Sass 3.3 as the interpolation created some unexpected results. See Nathan's Post on it

@Snugug
Copy link

Snugug commented Jun 10, 2014

Also see #286

@hinok
Copy link
Author

hinok commented Jun 10, 2014

@Snugug Thanks for fast response. I read these posts earlier. I'm aware of these changes.
What doesn't change the fact that I can't use multiple selectors now...

In my current project I used a lot of multiple classes selectors like the example above.
It would be great if I could get the string in some way from ampersand (&) and use interpolation like this

$el: &; // I know that it doesn't work now, it's only example
#{$el}--big#{$el}--active { ... }

Any ideas to solve this problem?

@nex3
Copy link
Contributor

nex3 commented Jun 13, 2014

You won't be able to do this until script & is reintroduced in Sass 3.4.

@nex3 nex3 closed this as completed Jun 13, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants