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

Whitespace discrepancies between 3.6.1 and 3.6.2 for rule blocks in nested mode #3018

Closed
sygint opened this issue Oct 28, 2019 · 5 comments · Fixed by #3021
Closed

Whitespace discrepancies between 3.6.1 and 3.6.2 for rule blocks in nested mode #3018

sygint opened this issue Oct 28, 2019 · 5 comments · Fixed by #3021

Comments

@sygint
Copy link

sygint commented Oct 28, 2019

I apologize if this isn't the best examples, this was tricky difficult to represent. The spacing around the / and the missing tab indent are what I'm trying to represent, but I suspect there are more issues than this, like rules having new lines between them along with no indentation. I'd recommend checking the output of multiple long stylesheets like Bootstrap to see the differences between 3.6.1 and 3.6.2. I've currently resolved this by downgrading to 3.6.1. Thanks for all the good work you're doing on the project!

input.scss

#articles p {
	color: $_medium-dark-gray;
	font:normal 1.13px/1.18 $content-one-font; /* 11px/13px */
}
#clearAllFacets {
	.clear-facets-label {
		margin-right: -12px;
	}
}

Actual results

libsass 3.6.2

#articles p {
  color: #676767;
  font: normal 1.13px / 1.18 Arial, Helvetica, "Helvetica Neue", sans-serif;
  /* 11px/13px */ }
  #clearAllFacets .clear-facets-label,
#clearAllFacets .clear-facets-icon {
    cursor: pointer; }

Expected result

libsass 3.6.1

#articles p {
  color: #676767;
  font: normal 1.13px/1.18 Arial, Helvetica, "Helvetica Neue", sans-serif;
  /* 11px/13px */ }
  #clearAllFacets .clear-facets-label,
  #clearAllFacets .clear-facets-icon {
    cursor: pointer; }

version info:

$ sassc -v
sassc: 3.6.1
libsass: 3.6.2
sass2scss: 1.1.1
sass: 3.5
@saper saper changed the title Upgrading from 3.6.1 to 3.6.1 generates whitespace discrepancies between rule blocks Upgrading from 3.6.1 to 3.6.2 generates whitespace discrepancies between rule blocks Oct 28, 2019
@saper saper added LibSass 3.6 Somewhere between Sass 3.5 and 4.0 Bug - Whitespace labels Oct 28, 2019
@mgreter
Copy link
Contributor

mgreter commented Oct 29, 2019

I can't reproduce this !?

@mgreter
Copy link
Contributor

mgreter commented Oct 29, 2019

IMO it works as expected, since we changed the extend logic to match dart sass, some whitespace differences that exist in dart sass vs ruby sass are now also present in libsass.

https://github.com/sass/dart-sass/blob/master/differences.md

newlines are never preserved within complex selectors

I have no idea how OP got the spaces around the dash / ...

@saper
Copy link
Member

saper commented Oct 29, 2019

Shouldn't 3.6.2 be 3.7.0 really?

@mgreter
Copy link
Contributor

mgreter commented Oct 29, 2019

Why? There shouldn't be any breaking changes.

Only white-space issue I found when comparing bootstrap with nested mode is:

input,
button {
  content: outer;
  &:focus {
    content: inner;
  }
}

There we seem to loose the indentation for the preserved newline.

@mgreter mgreter changed the title Upgrading from 3.6.1 to 3.6.2 generates whitespace discrepancies between rule blocks Whitespace discrepancies between 3.6.1 and 3.6.2 for rule blocks in nested mode Oct 29, 2019
@mgreter
Copy link
Contributor

mgreter commented Oct 29, 2019

Found another case which looses indentation

.container {
  content: outer;
  @media (min-width: 30px) {
    content: inner;
  }
}

Conclusion: we urgently need to get output mode specific spec tests back.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants