Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/styled-components/babel-plugin-polished

Compile polished helper functions at build time
https://github.com/styled-components/babel-plugin-polished

babel babel-plugin polished styled-components

Last synced: 29 days ago
JSON representation

Compile polished helper functions at build time

Awesome Lists containing this project

README

        

# babel-plugin-polished

Compile away [polished](https://polished.js.org/) helpers.

## Example

**In**

```js
import * as polished from 'polished';

let value = polished.clearFix();
```

**Out**

```js
let value = {
'&::after': {
clear: 'both',
content: '',
display: 'table'
}
};
```

## Installation

```sh
$ npm install babel-plugin-polished
```

## Usage

### Via `.babelrc` (Recommended)

**.babelrc**

```json
{
"plugins": ["polished"]
}
```

### Via CLI

```sh
$ babel --plugins polished script.js
```

### Via Node API

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