0.0.7 • Published 12 years ago
dcl-glyphicon v0.0.7
dcl-glyphicon
DCL Glyphicon widget. It is a Dual wrapper of Bootstrap Glyphicon.
It imports Twitter Bootstrap styles from 'dcl-bootstrap' module automatically.
Installation
npm install dcl-glyphiconUsage
Create an icon with new keyword:
var Icon = require('dcl-glyphicon');
var i = new Icon();
i.setGlyph('save');...or declaratively:
var D = require('dual');
var b = D.fromJSON([
'icon', //using alias 'icon'
{
glyph: 'ok'
}], {
icon : require('dcl-glyphicon') //declaring module 'dcl-glyphicon' as alias 'icon'
});Then use it:
// - in another Dual node:
myDualNode.appendChild(i);
// - directly in DOM tree:
document.body.appendChild(i.domify());
// - on the server:
res.end(i.stringify());Buiding
- All Dual and DCL parts are written in CommonJS, so
Browserifyis used for building JS. You just have torequire('dcl-glyphicon'). - Stylesheet is built with
grunt-dcl-resourcesandgrunt-less. Please, seeGruntfile.jsdemo task to find out how it is done.