-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
The method invalid_content_parent
is never called
#2106
Comments
I need to see a Sass source code example for this. |
Ok the bug is quite an edge case it seems libsassc is much more strict: @mixin breakpoint($args: null) {
// CASE IF NO DATA IS PASSED WE SHALL OUTPUT MEDIA QUERY ONLY FOR SCREEN THIS MEANS STYLES WILL BE GLOBALLY AND INHERITABLE BY UPPER BREAKPOINTS
@if $args == null {
@media screen {
@content;
}
}
// CASE IF DATA IS PASSED WE GENERATE BREAKPOINT FOR PASSED BREAKPOINT
@else {
@media screen and (min-width: $args) {
@content;
}
}
}
@mixin clearfix() {
a::after {
content: '';
display: table;
clear: both;
}
}
@include breakpoint() {
padding: 30px 0;
@include clearfix() {}
} libsassc
Ruby sassit renders without issue In any case this is something minor - I just found it bc. the front-end guy made that small mistake and thus the assets would not compile anymore was curios why that happened. |
Huh. Yeah, I would consider this a bug in ruby sass. A content block is not allowed to that mixin. @nex3 can you confirm? |
Yep, looks like a bug to me. Here's a much simpler repro: @mixin foo() {}
@include foo() {} It looks like we aren't recognizing the empty content block as something that could trigger the error. |
Displays error message 'Mixin "foo" does not accept a content block.' for this example: ```scss @mixin foo() {} @include foo() {} ``` Before, example was rendered without error and only failed if block inside @include had some statements. This is fix to: sass#2106 (comment)
This will test that lists are compared more strict. Related to: sass/sass#2106 and: sass/sass#2112
Tests that an error is raised whenever an empty block is passed to a mixin. Related to: sass/sass#2106 and: sass/sass#2112
This will test that lists are compared more strict. Related to: sass/sass#2106 and: sass/sass#2112
Tests that an error is raised whenever an empty block is passed to a mixin. Related to: sass/sass#2106 and: sass/sass#2112
This will test that lists are compared more strict. Related to: sass/sass#2106 and: sass/sass#2112
I'm moving this issue to the new Ruby Sass repository because it's specific to Ruby Sass's implementation. |
So I was investigation why using libsassc I was getting:
which is completely valid since
something
doesn't use@content
.https://github.com/sass/libsass/blob/master/src/expand.cpp#L666
Yet on the Ruby side nothing is reported and whilst reading a bit the code:
This method should set
has_content
to true:https://github.com/sass/sass/blob/stable/lib/sass/tree/visitors/check_nesting.rb#L82
but it doesn't seem to be called anywhere.
Hence this logic won't raise an exception if the mixin has no
@content
:https://github.com/sass/sass/blob/stable/lib/sass/tree/visitors/perform.rb#L354
The text was updated successfully, but these errors were encountered: