fela-plugin-unit
Advanced tools
Comparing version 3.0.1 to 3.0.2
{ | ||
"name": "fela-plugin-unit", | ||
"version": "3.0.1", | ||
"version": "3.0.2", | ||
"description": "Fela plugin to automatically add units if required", | ||
@@ -24,4 +24,4 @@ "main": "index.js", | ||
"peerDependencies": { | ||
"fela": "3.0.1" | ||
"fela": "3.0.2" | ||
} | ||
} |
@@ -18,7 +18,39 @@ # fela-plugin-unit | ||
<!-- Fela (Development): Unminified version including all warnings --> | ||
<script src="https://unpkg.com/fela-plugin-unit@3.0.1/dist/fela-plugin-unit.js"></script> | ||
<script src="https://unpkg.com/fela-plugin-unit@3.0.2/dist/fela-plugin-unit.js"></script> | ||
<!-- Fela (Production): Minified version --> | ||
<script src="https://unpkg.com/fela-plugin-unit@3.0.1/dist/fela-plugin-unit.min.js"></script> | ||
<script src="https://unpkg.com/fela-plugin-unit@3.0.2/dist/fela-plugin-unit.min.js"></script> | ||
``` | ||
## Usage | ||
Make sure to read the documentation on [how to use plugins](http://fela.js.org/docs/advanced/Plugins.html). | ||
```javascript | ||
import { createRenderer } from 'fela' | ||
import unit from 'fela-plugin-unit' | ||
const renderer = createRenderer({ | ||
plugins: [ unit() ] | ||
}) | ||
``` | ||
### Configuration | ||
##### Parameters | ||
| Parameter | Value | Default | Description | | ||
| --- | --- | --- | --- | | ||
| unit | `ch`, `em`, `ex`, `rem`, `vh`, `vw`, `vmin`, `vmax`, `px`, `cm`, `mm`, `in`, `pc`, `pt`, `mozmm` | `px` | unit which gets applied | | ||
##### Example | ||
```javascript | ||
import { createRenderer } from 'fela' | ||
import unit from 'fela-plugin-unit' | ||
const unitPlugin = unit('em') | ||
const renderer = createRenderer({ | ||
plugins: [ unitPlugin ] | ||
}) | ||
``` | ||
## Example | ||
@@ -43,11 +75,3 @@ Let's say we want to have a custom property `size` that accepts a single number which will then be transformed into both `width` and `height` with a `px` unit applied. | ||
``` | ||
## Configuration | ||
By default it adds `px` to the value, but you may use units other than that. | ||
```javascript | ||
import unit from 'fela-plugin-unit' | ||
const plugin = unit('em') | ||
``` | ||
## License | ||
@@ -54,0 +78,0 @@ Fela is licensed under the [MIT License](http://opensource.org/licenses/MIT).<br> |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
18582
31110
79