-
Notifications
You must be signed in to change notification settings - Fork 467
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
selector lists access with nth
should not return a list
#2020
Comments
IMO I already seen the root for this before and I still consider it inconsistent behavior by ruby sass:
libsass vs ruby sass
It looks like a special rule that complex selectors (converted to strings btw) are of type list, but are not printed as |
@mgreter this not an inconsistency in Sass, it's an important part of Sass semantics around selector lists.
In this selector {
$p: &;
a: $p;
b: length($p);
c: nth($p, 1);
d: length(nth($p, 1));
e: nth(nth($p, 1), 1);
}
selector1, selector2 {
$p: &;
a: $p;
b: length($p);
c: nth($p, 1);
d: length(nth($p, 1));
e: nth(nth($p, 1), 1);
}
selector1 subselector1, selector2 subselector2 {
$p: &;
a: $p;
b: length($p);
c: nth($p, 1);
d: length(nth($p, 1));
e: nth(nth($p, 1), 1);
} Should produce selector {
a: selector;
b: 1;
c: selector;
d: 1;
e: selector;
}
selector1, selector2 {
a: selector1, selector2;
b: 2;
c: selector1;
d: 1;
e: selector1;
}
selector1 subselector1, selector2 subselector2 {
a: selector1 subselector1, selector2 subselector2;
b: 2;
c: selector1 subselector1;
d: 2;
e: selector1;
} Give this information the following makes sense.
I'm happy to work you answering any questions about Sass semantics if you're unsure why something is happening. It's better to take the time to fully understand an issue so an appropriate fix can be implemented. Add small hacks just results is more edge cases that aren't really edge cases. |
I'm talking about selector {
inspect: nth(&, 1);
type: type-of(nth(&, 1));
} which is rendered as selector {
inspect: selector;
type: list; } The rule ought to be a list with one item is wrapped in |
As I understand it
As a result the |
Pretty much, so since selector lists go through listize and are converted to |
test:
ruby sass:
libsass:
The text was updated successfully, but these errors were encountered: