New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

react-suitcss-mixin

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-suitcss-mixin

A React component mixin to generate CSS class names that conform to SUIT CSS naming conventions.

latest
Source
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

react-suitcss-mixin

A React component mixin to generate CSS class names that conform to SUIT CSS naming conventions.

This mixin provides several primary functions.

  • Provide a general purpose getClassName method that accepts a variety of options for generating SUIT CSS conformant class names. This method accepts an optional parameter that may contain any of the following options.
  • namespace - Defaults to component's namespace property
  • componentName - Defaults to component's displayName property
  • descendantName
  • modifiers
  • states
  • utilities - Defaults to values from this.props.utilities
  • Allow generic utility classes to be passed in from a utilities prop.
  • Allow arbitrary CSS class names to be added using the standard React className prop.

Installation

npm install react-suitcss-mixin

Basic Usage

var React = require('react');
var SuitCss = require('react-suitcss-mixin');

var MyComponent = React.createClass({
  mixins: [SuitCss],

  render: function() {
    return <div className={ this.getClassName() }></div>
  }
});

React.render(<MyComponent/>, document.body);

Renders as:

<div class="MyComponent"></div>

Advanced Usage

Browse the demo files or just run the demo.

npm run demo

Build

npm run build

Tests

npm test

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code.

Release History

  • 1.0.1 - Update dependencies. Fix test mock. Update readme.
  • 1.0.0 - Camelize and capitalize componentName
  • 0.0.5 - Use Object.assign polyfill from react/lib. Update .npmignore and readme.
  • 0.0.4 - Initial release

Keywords

react

FAQs

Package last updated on 26 May 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts