Skip to content

About

React-like inline styles for Marionette Views

Resources

Stars

5 stars

Watchers

1 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

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

Stars

5 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages