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

babel-plugin-transform-prejss

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-transform-prejss

Get the power of PostCSS and Babel with plugins in your JSS styles. Just put CSS into JS and get it as JSS object.

  • 0.5.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

babel-plugin-transform-prejss

Travis branch npm version npm downloads npm license

Babel plugin which turns PreJSS constructions into JSS objects.

Example

In

const button = ({selector}) => preJSS`
  button {
    color: ${props => props.disabled ? 'grey' : 'red'};
    width: 200px;
    height: 70px;
    &:hover {
      text-decoration: underline;
    }
  }
`

Out

var button = function button(_ref) {
  var selector = _ref.selector;
  return {
    'button': {
      'color': function color(props) {
        return props.disabled ? 'grey' : 'red';
      },
      'width': '200px',
      'height': '70px',
      '&:hover': {
        'textDecoration': 'underline'
      }
    }
  };
};

See more details here: https://github.com/axept/prejss

Installation

npm install babel-plugin-transform-prejss --save-dev

Usage

Options

  • removeImport: <Boolean|String> - by default is prejss. You can configure it to false if you wouldn't like to remove imports for "prejss" automatically. But think twice! By disabling this option you may include server code and a lot of unnecessary dependencies into your bundle.

  • silent: <Boolean> - by default is false. This option is configuring if the plugin should or not to log about each removed prejss import.

  • namespace: <String> - by default is preJSS

.babelrc

{
  "plugins": ["transform-prejss"]
}

Via CLI

babel --plugins transform-prejss script.js

Via Node API

require("babel-core").transform("code", {
  plugins: ["transform-prejss"]
});

Keywords

FAQs

Package last updated on 27 Mar 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