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

SCSS compiler bug #297

Closed
RaptorCZ opened this issue Feb 25, 2014 · 4 comments
Closed

SCSS compiler bug #297

RaptorCZ opened this issue Feb 25, 2014 · 4 comments

Comments

@RaptorCZ
Copy link

Hello,
as reported here madskristensen/WebEssentials2013#670 and here sass/node-sass#249

There is a bug in scss compiler.

First, here is example (http://raptor.cestiny.cz/Temp/test_scss.zip).
Let's say, we have scss (test2.scss it is just part of code from Telerik skins). When file is compiled with Mindscape Workbench, correct output is in css (check test2_ok.css), but when it is compiled in Web Essentials, there is wrong output (test2_bad.css). Variable is not resolved and is simply copied to output.

I hope this is really my last issue reporting, because I'm getting tired with looking for source of this problem.

@nschonni
Copy link
Collaborator

To make this easier for others once the zip invariably gets deleted

Source

$skin-name: "CMS_Black";

$QUOTE: unquote('"');
$EMPTY_STRING: unquote( "" );
$SLASH: unquote("/");

$SKINS_PATH: unquote("/CMS/Skins");
$URL_SEPARATOR: $SLASH;
$URL_PREFIX: $EMPTY_STRING;
$URL_SUFFIX: $EMPTY_STRING;

$_URL_PREFIX: $URL_PREFIX + $EMPTY_STRING;
$_URL_SUFFIX: $URL_SUFFIX + $EMPTY_STRING;
$_URL_SEPARATOR: $URL_SEPARATOR + $EMPTY_STRING;
$_SKINS_PATH: $SKINS_PATH + $EMPTY_STRING;

@function webresource-image-url( $skin, $control, $file ) 
{
    $_url: $EMPTY_STRING;
    $_path: $_SKINS_PATH $skin $control;

    @each $_part in $_path {
        $_url: $_url + $_part + $_URL_SEPARATOR
    }

    @return $_URL_PREFIX + $QUOTE + $_url + $file + $QUOTE + $_URL_SUFFIX;
}

@function global-image-url( $skin, $control, $file ) {
    @return webresource-image-url( $skin, $control, $file );
}

@function skin-image-url( $control, $file ) {
    @return global-image-url( $skin-name, $control, $file );
}


$actions-sprite: skin-image-url( "Common", "radActionsSprite.png" );




.test 
{
    background-image: url( $actions-sprite );
}

Expected

.test {
  background-image: url("/CMS/Skins/CMS_Black/Common/radActionsSprite.png"); }

Actual

.test {
  background-image: url( $actions-sprite ); }

@RaptorCZ
Copy link
Author

Zip is on my web site and will keep it online :-) Really need fix for this, because Mindscape Workbench is slow as hell.

@nschonni
Copy link
Collaborator

Dupe of #273 which is fixed in master. You will need to wait for sass/node-sass#233 for a fix to bubble up to your IDE, but till then you can use the solution from the linked issue

.test 
{
    background-image: url('#{$actions-sprite}');
}

@akhleung
Copy link

akhleung commented Mar 3, 2014

Agreed, this is fixed in master. (LibSass doesn't quote the URL the way that Ruby Sass does, but the output is semantically correct.)

@akhleung akhleung closed this as completed Mar 3, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants