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: 11 months ago
JSON representation
Compile polished helper functions at build time
- Host: GitHub
- URL: https://github.com/styled-components/babel-plugin-polished
- Owner: styled-components
- License: mit
- Created: 2017-03-28T20:32:01.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2021-05-08T10:06:36.000Z (almost 5 years ago)
- Last Synced: 2025-03-12T21:02:57.958Z (12 months ago)
- Topics: babel, babel-plugin, polished, styled-components
- Language: JavaScript
- Homepage:
- Size: 34.2 KB
- Stars: 138
- Watchers: 4
- Forks: 13
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-list - babel-plugin-polished - components | 136 | (JavaScript)
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"]
});
```