medialize / browser-sass

Browser bindings to libsass (via Sass.js)
MIT License
5 stars 0 forks source link

download and process `<link … type="text/scss">` #1

Open rodneyrehm opened 9 years ago

rodneyrehm commented 9 years ago

Taking over from medialize/sass.js#28:

Create facilities to find <link … type="text/scss"> elements, download them and run them through Sass.compile(). Provide an importer callback to resolve nested @imports, possibly using URI.absoluteTo().

There is an initial attempt to make this work.

bassjobsen commented 9 years ago

Taking the demo at https://github.com/medialize/browser-sass/issues/2#issuecomment-99395642 into account. You should be able to read @import directive from source:

scssCode = xmlhttp.responseText;

If scssCode contain any @import "..." then find the URI and call read(uri) recursive. You still have to solve the asynchronism issues, but you dont need a modified version of sass.js