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

No error reported when @extend fails and the extender contains certain combinators #1816

Closed
andrew-skybound opened this issue Aug 26, 2015 · 4 comments
Labels
bug Something isn't working requires deprecation Blocked on a deprecation cycle

Comments

@andrew-skybound
Copy link

I believe this should be an error, since the !optional flag is not specified here and no rules are actually being extended. The a > b.foo rule cannot be extended by c > .bar because a is not mergeable (wrong word?) with c.

It's worth noting that the same problem occurs—no error is reported—when the + combinator is used in place of the >.

Input SASS:

a > b.foo {a: b}
c > .bar {@extend .foo}

Output CSS (should just be an error):

a > b.foo {
  a: b;
}
@davidkpiano
Copy link

This looks correct. In Sass, selector unification is ignored for selectors that are impossible to unify, such as a > b.foo and c > .bar.

@andrew-skybound
Copy link
Author

It seems to me that the fact that it's ignoring the selector is precisely the problem. This is an error:

a > b.foo {a: b}
a > c.bar {@extend .foo}
Sass::SyntaxError: "a > c.bar" failed to @extend ".foo".
No selectors matching ".foo" could be unified with "a > c.bar".

Why is my first example above not an error, when this one is?

@chriseppstein
Copy link

This should be an error.

@chriseppstein chriseppstein added bug Something isn't working requires deprecation Blocked on a deprecation cycle labels Aug 27, 2015
@nex3
Copy link
Contributor

nex3 commented Apr 6, 2018

We decided to make this category of things no longer be an error. See #2250.

@nex3 nex3 closed this as completed Apr 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working requires deprecation Blocked on a deprecation cycle
Projects
None yet
Development

No branches or pull requests

4 participants