Nautical Pirate Moustache
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

babel-plugin-insert-css-module

1.0.4 • Public • Published

babel-plugin-insert-css-module

Inspired by https://github.com/martinandert/babel-plugin-css-in-js

Usage

import css from 'insert-css-module';
 
const buttonStyles = css`
  .normal {
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
  }
  .normal:hover {
    color: blue;
  }
  .danger {
    composes: normal;
    color: red;
  }
`;
 
console.log('<button class="' + buttonStyles('normal') + '"/>');
console.log('<button class="' + buttonStyles('danger') + '"/>');

Keywords

install

npm i babel-plugin-insert-css-module

Downloadsweekly downloads

1

version

1.0.4

license

none

repository

githubgithub

last publish

collaborators

  • avatar