Skip to content

happylinks/backbone.marionette.style

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Backbone Marionette Style

React-like inline styles for Marionette Views

Travis build status Code Climate Test Coverage Dependency Status devDependency Status

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.

About

React-like inline styles for Marionette Views

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published