Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

fela-plugin-unit

Package Overview
Dependencies
Maintainers
1
Versions
111
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fela-plugin-unit - npm Package Compare versions

Comparing version 3.0.1 to 3.0.2

4

package.json
{
"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>

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc