Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/styled-components/babel-plugin-polished
- Owner: styled-components
- License: mit
- Created: 2017-03-28T20:32:01.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2021-05-08T10:06:36.000Z (over 3 years ago)
- Last Synced: 2024-05-11T15:32:20.111Z (6 months ago)
- Topics: babel, babel-plugin, polished, styled-components
- Language: JavaScript
- Homepage:
- Size: 34.2 KB
- Stars: 138
- Watchers: 5
- 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"]
});
```