Socket
Socket
Sign inDemoInstall

classnameify

Package Overview
Dependencies
9
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    classnameify

Generate classname selectors for CSS components, works splendid together with e.g. React


Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Install size
36.8 kB
Created
Weekly downloads
 

Readme

Source

classnameify

Build status NPM version js-xo-style

Generate classname selectors for CSS components, works splendid together with e.g. React

Why?

Generating classnames according to the contents of CSS declarations solves the biggest problem with large scale CSS, i.e. the fact that it cascades. See unistyle for how to use this in a scalable way.

Installation

Install classnameify using npm:

npm install --save classnameify

Usage

Module usage

var classnameify = require('classnameify');

classnameify({
  myComponent: {
    color: '#FFF',
    fontSize: '10px'
  }
});
/*
 {
  '._e80a8a8': {
    color: '#FFF',
    fontSize: '10px'
  }
 }
*/
Usage together with e.g. React

Have a look at unistyle for how this fits together with React.

API

classnameify(val)

NameTypeDescription
val`ObjectArray`

Returns: Object.

License

MIT © Joakim Carlstein

Keywords

FAQs

Last updated on 03 Sep 2015

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc