Here's how to build an app with something like CanJS and AMD-like modules (using steal). For this example app, consider a tree-like nested grid where you can select locations and get more information. The app might look something like:
IL | |
Chicago |
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
Here's how to build an app with something like CanJS and AMD-like modules (using steal). For this example app, consider a tree-like nested grid where you can select locations and get more information. The app might look something like:
IL | |
Chicago |
Handlebars.registerHelper('pagination', function(currentPage, totalPage, size, options) { | |
var startPage, endPage, context; | |
if (arguments.length === 3) { | |
options = size; | |
size = 5; | |
} | |
startPage = currentPage - Math.floor(size / 2); | |
endPage = currentPage + Math.floor(size / 2); |
@import "bootstrap/responsive.less"; //Disable importing variables and mixins, causes to break.. | |
// LANDSCAPE PHONE TO SMALL DESKTOP & PORTRAIT TABLET | |
// -------------------------------------------------- | |
@media (max-width: 767px) { | |
.customGrid(auto, 0); | |
} | |
// PORTRAIT TABLET TO DEFAULT DESKTOP | |
// ---------------------------------- |
/* ===== Primary Styles ===================================================== | |
Author: Fruitcake Studio (Barry vd. Heuvel) | |
========================================================================== */ | |
//Generate a custom (semantic) grid | |
.customGrid(@gridColumnWidth, @gridGutterWidth){ | |
#header, #main { | |
.row(); | |
} | |
.block { |
<?php | |
/** | |
* PHP versions 5 | |
* | |
* @copyright 2011 k-holy <[email protected]> | |
* @author [email protected] | |
* @license http://www.opensource.org/licenses/mit-license.php The MIT License (MIT) | |
*/ | |
namespace Holy\Silex\Provider; |
Backbone helps you structure your application. This is great, but it doesn't solve the whole problem. CanJS helps you structure your application and lets you actually focus on the part that matters, which is your data.
CanJS essentially gives you all the simplicity of Backbone (model and control layer and no weird asynchronous event loop like Ember and Angular), along with more advanced features that make writing apps much faster and the code more maintainable.
Backbone is popular because its very simple and easy to understand. They are aiming for that level JUST above basic jQuery development, people who just learned jQuery and are looking for a way to organize their code a bit more. It provides this. So does CanJS. But for large complex applications, Backbone lacks a lot of the things we need to make a great app.
Backbone has no concept of binding data object and their changes to your templates.
For this tutorial I'm assuming you are already comfortable with CSS, Sass (I'll use the SCSS syntax) and Compass. Please get set up with each one of those before attempting to use Susy. Sass and Compass both have their own setup instructions and tutorials that you can use.
There is also reference documentation in the works.
CSS Systems
@import "colors"; | |
@import "buttons.scss"; | |
@import "compass/css3"; | |
@mixin tabs { | |
float: left; | |
width: 100%; | |
background: transparent; | |
margin: 0!important; | |
height: 43px; |