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

babel-plugin-jss-simple

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

babel-plugin-jss-simple

Add filename keys to your jss-simple declarations to help with hot reloading

  • 0.2.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

babel-plugin-jss-simple

js-standard-style

Add filename keys to your jss-simple declarations to help with hot reloading

Installation

$ npm install babel-plugin-jss-simple

What it does

It transforms this:

import css from 'jss-simple'

const style = css({
  primary: {
    color: 'green'
  }
})

into this:

import css from 'jss-simple'

const style = css({
  primary: {
    color: 'green'
  }
}, __filename)

Why do I want this?

If you are using hot module replacement on the client, you won't be able to tell which styles are the new styles. This provides a key (the filename) to jss-simple so that it can replace the previous style with the new style, and your stylesheet doesn't grow huge.

Do I have to call it 'css'?

No. It will track whatever you've called your default import and rewrite it appropriately.

Can I use css more than once in a given file?

Yes. Each instance of the call will be keyed separately, with _<n> being suffixed to the file name key.

License

MIT

FAQs

Package last updated on 30 Jan 2016

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