jedfoster / SassMeister

The Sass playground
http://sassmeister.com
198 stars 25 forks source link

%placeholder works only in sassy syntax, not in sass #201

Closed wilmaed closed 6 years ago

wilmaed commented 6 years ago
%foo
  color:black
b
  @extend %foo
  font-size: 12px 

"b" failed to @extend "%foo". Why?

No error in sassy syntax:


%foo {
  color:black
}

b {
  @extend %foo;
  font-size: 12px;
}
jedfoster commented 6 years ago

Works with SCSS syntax: https://www.sassmeister.com/gist/f8e62964da4e1898d2108c31cbff20bd Works with Sass syntax: https://www.sassmeister.com/gist/07af5909ad0f62e7d850caba54f768fc

wilmaed commented 6 years ago

Works not with sass syntax: screen1

Works not with sass syntax: screen2

wilmaed commented 6 years ago

my sample works only with your url Works with Sass syntax: https://www.sassmeister.com/gist/07af5909ad0f62e7d850caba54f768fc

not with www.sassmeister.com

jedfoster commented 6 years ago

Do me a favor and add a space before black on line 2.

%foo
  color: black

I'm pretty sure the Sass syntax requires a space after colons in property declarations; and a missing space would cause that placeholder class to be invalid, and thus "not found."

If that doesn't fix it, please report this issue to the Sass organization, https://github.com/sass/sass/issues

wilmaed commented 6 years ago

Yes, this will fix it.

This is strange, because it works without space with 2 online compiler:

It's working on beautifytools.com:

screen3

and here on sass.js: screen4

jedfoster commented 6 years ago

¯\_(ツ)_/¯

Both of those tools use a hacky implementation of Sass that's transpiled into JavaScript and runs in the browser. SassMeister.com uses the real Sass binaries and runs server-side, rendering exactly the same output you would get if you compiled locally. Can't say the same for the Emscripten ports.