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

BEM Modifiers With Number Prefixes #738

Closed
MethodGrab opened this issue Dec 18, 2014 · 7 comments · Fixed by #739
Closed

BEM Modifiers With Number Prefixes #738

MethodGrab opened this issue Dec 18, 2014 · 7 comments · Fixed by #739

Comments

@MethodGrab
Copy link

If a Sass 3.3 style BEM modifier starts with a number, it will fail to compile in libsass with the error invalid property name.

Tested against libsass 3.0.2 on SassMeister. Ruby Sass 3.4.9 compiles this without error.
Note: It's just modifier (--) that fails, BEM elements (__) work fine.

For example:

.foo {
  &--bar { color: red; }
  &--1bar { color: blue;}
}

Should compile to

.foo--bar { color: red; }
.foo--1bar { color: blue; }

This example will compile as expected in libsass:

.foo {
  &--bar { color: red; }
  &__1bar { color: blue;}
}
@xzyfer
Copy link
Contributor

xzyfer commented Dec 19, 2014

Specs added sass/sass-spec#186

@MethodGrab
Copy link
Author

Thanks! 👍

@pierremanceaux
Copy link

Not sure to understand, does this closed issue actually means that

.element {
    &--modifier {
        color: red;
    }
}

should not output image anymore ?

I'm actually using grunt-sass (https://github.com/sindresorhus/grunt-sass) and it fails on every modifiers selectors (&--)

@xzyfer
Copy link
Contributor

xzyfer commented Jan 9, 2015

@pierremanceaux grunt sass is still using an older version of Libsass. This is fixed in Libsass 3.1.0.

@pierremanceaux
Copy link

@xzyfer thanks for you quick answer :)
Just to know, is it possible to update the version of libsass used by grunt-sass?

@xzyfer
Copy link
Contributor

xzyfer commented Jan 9, 2015

Grunt-sass uses node-sass. You'll have to wait for node-sass 2.0.0 to go
stable and open an issue with the grunt-sass team to update.
On 9 Jan 2015 21:02, "Pierre Manceaux" [email protected] wrote:

@xzyfer https://github.com/xzyfer thanks for you quick answer :)
Just to know, is it possible to update the version of libsass used by
grunt-sass?


Reply to this email directly or view it on GitHub
#738 (comment).

@pierremanceaux
Copy link

Great, got it, thanks a lot for you time xzyfer.

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

Successfully merging a pull request may close this issue.

3 participants