Created
July 17, 2012 18:33
-
-
Save derek/3131146 to your computer and use it in GitHub Desktop.
YUI starter - simple
This file contains 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
<!DOCTYPE html> | |
<html> | |
<meta charset='utf-8'> | |
<head> | |
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/3.5.1/build/cssreset/cssreset-min.css"> | |
<style> | |
/* Styles can go here, in the 'my-css' module, or both! */ | |
</style> | |
<script src="http://yui.yahooapis.com/3.5.1/build/yui/yui-min.js"></script> | |
</head> | |
<body> | |
<p id="message"></p> | |
<img src="http://reid.github.com/decks/2011/jsconf/logo.png" height="300"> | |
<script> | |
YUI({ | |
/* Some additional configs useful for development */ | |
//base: "http://localhost:3000/", | |
//combine: false, | |
//debug: false, | |
//filter:"raw", | |
modules: { | |
'my-module': { | |
fullpath: 'my-module.js', | |
requires: ['node', 'my-css'] | |
}, | |
'my-css': { | |
fullpath: 'my-css.css', | |
type: 'css' | |
} | |
} | |
}).use('my-module', function (Y) { | |
Y.one('#message').setContent(Y.message); | |
}) | |
</script> | |
</body> | |
</html> |
This file contains 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
html, body{ | |
text-align: center; | |
} | |
#message { | |
font-size: 5em; | |
} |
This file contains 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
YUI.add('my-module', function (Y) { | |
Y.message = "Success!"; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment