Nuclear Pumpkin Mocha

    backbone.marionette.style

    0.1.0 • Public • Published

    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.

    Install

    npm i backbone.marionette.style

    DownloadsWeekly Downloads

    1

    Version

    0.1.0

    License

    ISC

    Last publish

    Collaborators

    • michielwesterbeek