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

jss-default-unit

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jss-default-unit

JSS plugin that adds default custom unit to numeric values where needed

  • 3.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
88K
decreased by-16.1%
Maintainers
1
Weekly downloads
 
Created
Source

JSS logo

JSS plugin that adds default custom unit to numeric values where needed

This plugin lets you omit the unit from values of style properties. Default unit is "px", but you can pass anything else instead.

Demo - JSS

![Gitter](https://badges.gitter.im/Join Chat.svg)

Usage example

import jss from 'jss'
import defaultUnit from 'jss-default-unit'

// px is default, lets make default to em
jss.use(defaultUnit({unit: 'em'}))

let sheet = jss.createStyleSheet({
  container: {
    'font-size': 20,
    'z-index': 1,
    'line-height': 1.2
  }
})
console.log(sheet.toString())
.jss-0-0 {
  font-size: 20em;
  z-index: 1;
  line-height: 1.2;
}
console.log(sheet.classes)
{ container: "jss-0-0" }

Issues

File a bug against jsstyles/jss prefixed with [jss-default-unit].

Run tests

npm i
npm run test

License

MIT

Keywords

FAQs

Package last updated on 16 Jul 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