Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Saving '&' as a variable #829

Closed
tenhobi opened this issue Apr 2, 2015 · 3 comments
Closed

Saving '&' as a variable #829

tenhobi opened this issue Apr 2, 2015 · 3 comments

Comments

@tenhobi
Copy link

tenhobi commented Apr 2, 2015

Hi, in my code I save & into variable $parent and after that I use it as a selector.

(I use the gulp-sass which using node-sass)

Example of my code is below - which uses my super idea how to make the .switch--people__radio:checked + .switch--people__label selector.

  &--people {
    $parent: &;

    &__radio {
      display: none;
      margin: 0;
      padding: 0;

      &:checked + #{$parent}__label {
        font-weight: $g-weight-semi-bold;
        color: $g-color-primary;
      }
    }

But it throws an error.

[14:29:17] Starting 'sass'...

stream.js:94
      throw er; // Unhandled stream error i
n pipe.
            ^
Error: error reading values after :

Is there any way how to fix it?

I want to use node-sass, because it is much faster than the ruby version (in my case 328ms vs ~2,5s - which is a really big difference).

@tenhobi tenhobi changed the title Saving & as variable Saving '&' as a variable Apr 2, 2015
@Snugug
Copy link

Snugug commented Apr 2, 2015

The problem lives in Libsass, specifically sass/libsass#548

That being said, that says it's closed there, I can't get this to work with node-sass 3.0.0-beta.4. Probably because #827 needs to land first.

@tenhobi
Copy link
Author

tenhobi commented Apr 2, 2015

@Snugug thank you for the info. I will wait a few more days until the next release. :)

@am11
Copy link
Contributor

am11 commented Apr 3, 2015

Lets track the progress at #827.

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

No branches or pull requests

3 participants