SASS | CSS |
---|---|
|
|
SASS | CSS |
---|---|
|
|
SASS | CSS |
---|---|
|
|
rgba($red, $green, $blue, $alpha)
lighten($color, $amount)
darken($color, $amount)
saturate($color, $amount)
desaturate($color, $amount)
grayscale($color)
http://sassmeister.com/
SASS | LESS |
---|---|
|
|
#main { color: #fff; background-color: #000; }
#main p { width: 10em; }
.huge { font-size: 10em; font-weight: bold; text-decoration: underline; }
#main{color:#fff;background-color:#000}#main p{width:10em}.huge{font-size:10em;font-weight:bold;text-decoration:underline}
function getRandomItems(array, count) {
var randomArray = [], number;
while (randomArray.length < count) {
number = Math.round(Math.random() * array.length);
randomArray.push(array[number]);
}
return randomArray;
};
function getRandomItems(a, b) {
var c = [], d;
while (c.length < b) {
d = Math.round(Math.random() * a.length);
c.push(a[d]);
}
return c;
};
$ npm install module
$ npm install
<script src="js/app.js"></script>
<script src="js/controllers/thing-controller.js"></script>
<script src="js/models/thing-model.js"></script>
<script src="js/views/thing-view.js"></script>
<!-- endbuild -->
{
options: {
browsers: ['last 2 versions', 'ie 8', 'ie 9']
}
}
{
'img1.png': 'tmp/img1.59bcc3ad.png',
'img2.png': 'tmp/img2.060b1aa6.png'
}
$ bower init
$ bower install jquery
$ bower install jquery --save
{
"name": "rr",
"version": "0.0.0",
"dependencies": {
"angular": "1.2.16",
"es5-shim": "~3.1.0",
"angular-sanitize": "1.2.16",
"jquery": "~2.1.1"
},
"devDependencies": {
"angular-resource": "1.2.16",
"angular-route": "1.2.16"
},
"appPath": "app"
}
Grunt | Gulp |
---|---|
task runner | pipeline |
config file | js code |
$ npm install -g grunt-cli #puts the grunt command
$ npm init #creates package.json
$ npm install grunt --save #adds grunt to package.json
#run once
$ npm install -g grunt-init #grunt init cli
$ git clone https://github.com/gruntjs/grunt-init-jquery.git \
~/.grunt-init/jquery #download template
$ grunt-init commonjs #create a commonjs
$ npm install #install modules from template
$ grunt #run grunt task
#run once
$ npm install -g yo #install yeoman
$ npm install -g generator-angular #install angular template
$ yo angular [app-name] #create angular app
$ npm install #node dependencies
$ bower install #bower dependencies
$ grunt serve
$ grunt build
$ grunt serve:dist
$ grunt test