-
Notifications
You must be signed in to change notification settings - Fork 465
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
Investigate when (not) to insert the double linefeed #1030
Comments
Spec submitted: sass/sass-spec#299 |
I think I got a little further here (I actually missed that div {
a {
top: 10px;
@supports (will-change: transform) {
will-change: transform;
}
}
}
div {
a {
@supports (will-change: transform) {
will-change: transform;
}
bottom: 10px;
}
}
div {
a {
@supports (will-change: transform) {
will-change: transform;
}
@supports (will-change: transform) {
will-change: transform;
}
}
} Ruby sass will output this: div a {
top: 10px; }
@supports (will-change: transform) {
div a {
will-change: transform; } }
div a {
bottom: 10px; }
@supports (will-change: transform) {
div a {
will-change: transform; } }
@supports (will-change: transform) {
div a {
will-change: transform; } }
@supports (will-change: transform) {
div a {
will-change: transform; } } So it seems that ruby sass adds indentation only if the original block contains some other declarations. It is quite likely that this also indicates when to insert a double linefeed! |
@xzyfer this is basically all happening in cssize. The |
cssize is pretty much a one to one port of the sass cssize.rb. I'm very hesitant to make changes to cssize that cause it to diverge from the reference implementation until we have parity. |
@chriseppstein has suggested this may be a bug in the Ruby Sass implementation. We'd be better served fixing the issue on their end. |
Is there any update on this issue? |
@chriseppstein has confirmed the double newlines are a bug in Ruby Sass but a low priority. We'll wait for this to addressed upstream. |
I don't think there is anything we need to do here. These new lines have no semantic meaning. Sass spec normalises new lines which means this spec is currently passing. |
That's true but the idea was that libsass should match Ruby Sass output even with regards to whitespaces, wasn't it? |
Ideally yes. In reality some things aren't possible without matching the
|
Note: this will probably be fixed by ruby sass itself!
Libsass & Ruby Sass in many cases insert a double linefeed, e.g. after a block. There are differences in various edge cases, though, like what I reported in #1028. This requires investigation to what is the exact algorithm to generate those newlines.
An issue opened by advice from @mgreter.
The text was updated successfully, but these errors were encountered: