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

Sass output breaking loadStyleSheet() #93

Open
CHEWX opened this issue Feb 24, 2015 · 3 comments
Open

Sass output breaking loadStyleSheet() #93

CHEWX opened this issue Feb 24, 2015 · 3 comments

Comments

@CHEWX
Copy link

CHEWX commented Feb 24, 2015

I kept getting an error with IE8 on line 383:

    function loadStyleSheet( url ) {
        xhr.open("GET", url, false);
        xhr.send();
        return (xhr.status==200) ? xhr.responseText : EMPTY_STRING;
    };

This is because my Sass was being outputted as compressed, it needs to be compact.

I think this should be on the docs, took a long while to figure out.

The best way would be to output 2 stylesheets. One as compressed 'main.css' and one 'main-ie.css' as compact and conditionally load them.

@CHEWX CHEWX changed the title Sass Output breaking loadStyleSheet() Sass output breaking loadStyleSheet() Feb 24, 2015
@ArmorDarks
Copy link

Having two versions of css just because of that error doesn't sound good, to be honest...

Duplicate of #66

@ganlanyuan
Copy link

I encountered this problem too, but later I figured out that Selectivizr has some issues dealing with @import rule and urls. After I change lines 447-455

return loadStyleSheet(url).replace(RE_COMMENT, EMPTY_STRING).
            replace(RE_IMPORT, function( match, quoteChar, importUrl, quoteChar2, importUrl2, media ) {
                var cssText = parseStyleSheet(resolveUrl(importUrl || importUrl2, url));
                return (media) ? "@media " + media + " {" + cssText + "}" : cssText;
            }).
            replace(RE_ASSET_URL, function( match, isBehavior, quoteChar, assetUrl ) { 
                quoteChar = quoteChar || EMPTY_STRING;
                return isBehavior ? match : " url(" + quoteChar + resolveUrl(assetUrl, url, true) + quoteChar + ") "; 
});

to

return loadStyleSheet(url).replace(RE_COMMENT, EMPTY_STRING);

This was fixed.
Though I don't know the purpose of these two **replace()**s.

@ganlanyuan
Copy link

Sorry,
jesstelford actually fixed this issue. Check #69.

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