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

babel-plugin-styled-jss

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-styled-jss

Babel Plugin for styled-jss

  • 2.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
10
increased by100%
Maintainers
1
Weekly downloads
 
Created
Source
styled-jss

babel-plugin-styled-jss

This plugin created for styled-jss on top of PreJSS.

Install

npm install --save babel-plugin-styled-jss

Usage

.babelrc

{
  plugin: 'styled-jss'
}

This plugin transforms

const Button = styled.button`
  padding: 10;
  color: ${({color}) => color}
`

to

const Button = styled('button', {
  padding: 10,
  color: ({color}) => color
})

And you can also use plain objects:

const Button = styled.button({
  color: 'red'
})

Recognition

babel-plugin-styled-jss can recognize this patterns:

// you can also use your custom names like:
// import styledCustom from 'styled-jss'
import styled, {Styled} from 'styled-jss'

const Button = styled.button({
  color: 'blue'
})

const scoped = Styled({
  baseButton: {
    color: 'green'
  }
})
const AnotherButton = scoped.button({
  composes: '$baseButton'
})

And you can also use DI for example, but you need to name it as styled:

export default (styled) => {
  const Button = styled.button({color: 'red'})
}

License

MIT

Keywords

FAQs

Package last updated on 18 May 2017

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