backbone.marionette.style
v0.1.0
Published
React-like inline styles for Marionette Views.
Downloads
2
Maintainers
Readme
Backbone Marionette Style
React-like inline styles for Marionette Views
Usage
To use this Marionette Behavior, be sure to add it to the behaviorLookup.
import StyleBehavior from 'backbone.marionette.style';
Marionette.Behaviors.behaviorsLookup = function() {
return {
Style: StyleBehavior
};
};
After you've done this you can add the Style behavior to one of your views, like so:
var StyleView = Marionette.ItemView.extend({
template: _.template('<div></div>'),
behaviors: {
Style: {}
},
style: {
backgroundColor: '#000',
color: 'white',
fontSize: 14,
position: 'absolute'
}
});
Licenses
This module uses code from Facebook React to generate the css from the style object. Their licenses apply.
Also uses the basic setup for the plugin from Backbone.Storage.