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

Empty declarations sometimes being output #1106

Closed
xzyfer opened this issue Apr 15, 2015 · 4 comments · Fixed by #1109 or #1125
Closed

Empty declarations sometimes being output #1106

xzyfer opened this issue Apr 15, 2015 · 4 comments · Fixed by #1109 or #1125

Comments

@xzyfer
Copy link
Contributor

xzyfer commented Apr 15, 2015

.foo {
  foo: unquote(null); }

Ruby Sass 3.4.12

// no output

Ruby Sass 3.4.12

DEPRECATION WARNING: Passing null, a non-string value, to unquote()
will be an error in future versions of Sass.
        on line 2 of test.scss

Libsass 3.1.0

.foo { }

Libsass 3.2.0-beta.5

.foo {
  foo: ;}

Spec added sass/sass-spec#329

@xzyfer
Copy link
Contributor Author

xzyfer commented Apr 22, 2015

Still seeing this in 3.0.0-beta.6. I'll work on a reduced test case today.

@xzyfer
Copy link
Contributor Author

xzyfer commented Apr 23, 2015

$foo: red;
$bar: unquote(null);

.baz {
    foo: $foo;
    foo: $bar; }

.bax {
    foo: $bar; }

.bay {
    foo: $foo; }

Ruby Sass

.baz {
  foo: red; }

.bay {
  foo: red; }

Libsass 3.1.0

.baz {
  foo: red; }

.bax { }

.bay {
  foo: red; }

Libsass 3.2.0-beta.6

.baz {
  foo: red;
  foo: ;}

.bay {
  foo: red; }

@xzyfer
Copy link
Contributor Author

xzyfer commented Apr 23, 2015

This appears to be due a difference in unquote

foo { 
  bar: type-of(unquote(''));
  baz: type-of(unquote(null)) }

Ruby Sass

foo {
  bar: string;
  baz: null; }

Libsass

foo {
  bar: string;
  baz: string; }

@xzyfer
Copy link
Contributor Author

xzyfer commented Apr 23, 2015

Although the current patch solves the issue of not showing empty rulesets, due to #1124 in the special case of unquote(null) this breaks if there another non-null declaration in the ruleset.

$foo: null;
foo {
  a: $foo;
  b: $foo; }
bar {
  a: b;
  b: unquote($foo); }

Ruby Sass

bar {
  a: b; }

Libsass 3.1

bar {
  a: b; }

Libsass 3.2.0-beta.6

bar {
  a: b;
  b: ;}

I have update the spec to reflect this new information - sass/sass-spec#336

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