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

Fela plugin to automatically add units if required

  • 1.0.0-beta.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
6.7K
decreased by-78.1%
Maintainers
1
Weekly downloads
 
Created
Source

fela-plugin-unit

Always writing length values as string with a value applied seems not like the JavaScript way to do it. You can also use mathematics to process number values.
It is aware of unitless properties such as lineHeight and also adds units to multiple values inside an array.

{
  width: 25,
  lineHeight: 1.4,
  height: '53'
}

would be transformed into:

{
  width: '25px',
  lineHeight: 1.4,
  height: '53px'
}

Configuration

By default it adds px to the value, but you may use units other than that.

import unit from 'fela-plugin-unit'

const plugin = unit('em')

Keywords

FAQs

Package last updated on 16 Jun 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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