Skip to content
This repository has been archived by the owner on Aug 18, 2020. It is now read-only.

vkbansal/css-tagged-template-to-object

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NPM version Build Status Dependency Status Dev Dependency Status

babel-plugin-transform-css-tagged-template-to-object

Babel Plugin to convert css tagged literals to javascript objects. Intended to be used with CSS-in-JS libraries like glamor.

It transpiles the following

export const $switch = css`
    display: inline-flex;
    vertical-align: middle;
    height: 34px;
    align-items: flex-end;
`;

into this

export const $switch = css({
    display: 'inline-flex',
    verticalAlign: 'middle',
    height: '34px',
    alignItems: 'flex-end'
});

Install

Use npm

npm install -S babel-plugin-transform-css-tagged-template-to-object

Add the following to your .babelrc or package.json. Whichever you prefer.

{
    "plugins": [
        "transform-css-tagged-template-to-object"
    ]
}

About

babel-plugin-transform-css-tagged-template-to-object

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published