-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Nested File-Import with Sub-Element Selector has unexpected result #2395
Comments
Could you please provide more info on why you think it "fails"? In fact the result is expected (I guess the point of your confusion is the behaviour of |
The unexpected part is the difference between: .some {
&_thing &_within { ... }
} which, I guess, renders to: .some_thing .some_within { ... } But when it's nested, as shown above /* main.less */
.wrap {
@import 'include.less'
}
/* include.less */
.some {
&_thing &_within { ... }
}
compiles to .wrap .some_thing .wrap .some_within { ... }
but I believe it should be .wrap .some_thing .some_within { ... } Otherwise it messes the nested single selector up. Don't you think so, @seven-phases-max? Otherwise it would not be possible to wrap a BEM-Block easy inside of another block ( EDIT: After thinking about this more, I understand your point - less respects the wrapping element around the element as parent. But don't you think this is confusing? Could it be thinkable to have the ability for passing in the context of an import like: .wrap {
@import 'some.less'
}
/* some.less */
// context == .wrap
.wrap {
@import (no-context) 'some.less'
}
/* some.less */
// context == '' |
Well, no, regardless of what we think personally the
The So in summary: this is expected behaviour. (See also related #1075 feature request as well as duplicates of this one: #9, #127, #1158, #1575, #2388 etc.) |
Closing as expected behaviour. |
Result:
OS: Ubuntu 14.10
Less-Version:
[email protected]
The text was updated successfully, but these errors were encountered: