Created
May 16, 2012 16:14
-
-
Save BDQ/2711760 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
compile_styles: function(){ | |
var palette = Spraycan.palettes.find(function(palette){ return palette.get('active') }); | |
var config_template = JST["spraycan/templates/shared/less_config"]; | |
var less_css = config_template({ palette: palette}); | |
less_css += window.frames[0].$jQ('style#source')[0].textContent; | |
var parser = less.Parser(); | |
parser.parse(less_css, function(error, result){ | |
if(error == null){ | |
if(window.frames[0].$jQ("style#compiled").length==0){ | |
window.frames[0].$jQ("head").append("<style id='compiled'></style>"); | |
} | |
window.frames[0].$jQ("style#compiled").html(result.toCSS()); | |
} | |
}); | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment