Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

classnameify

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

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

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
increased by200%
Maintainers
1
Weekly downloads
 
Created
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

Package last updated on 03 Sep 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

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc