Skip to content

Instantly share code, notes, and snippets.

@unscriptable
Created November 16, 2011 15:59
Show Gist options
  • Save unscriptable/1370465 to your computer and use it in GitHub Desktop.
Save unscriptable/1370465 to your computer and use it in GitHub Desktop.
AMD css support

CSS AMD plugins

curl/plugin/link: https://github.com/unscriptable/curl/blob/master/src/curl/plugin/link.js

  • the link! plugin is ultra-simple, but doesn't wait for the stylesheet to be applied
  • should work with any AMD loader, including RequireJS

curl/plugin/css: https://github.com/unscriptable/curl/blob/master/src/curl/plugin/css.js

  • loads and waits for CSS
  • embeds css into javascript during build process
  • will soon be upgraded to take advantage of onload/onerror in FF/IE
  • only works with curl.js

RequireCSS: https://github.com/VIISON/RequireCSS

  • specifically built for RequireJS (only works with RequireJS, afaik)
  • loads and waits for css
@peller
Copy link

peller commented May 14, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment