New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

postcss-default-unit

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postcss-default-unit

PostCSS plugin that adds a default unit to numeric css properties

latest
Source
npmnpm
Version
1.1.0
Version published
Maintainers
1
Created
Source

PostCSS Default Unit

Build Status NPM version Dependency Status

PostCSS plugin that adds a default unit to numeric css properties.

.foo {
    width: 200;
    margin: 0 auto 20;
    z-index: 1;
}
.foo {
    width: 200px;
    margin: 0 auto 20px;
    z-index: 1;
}

Install

With npm do:

npm install postcss-default-unit --save

Usage

By default px is used.

postcss([ require('postcss-default-unit') ])

You can specify the desired unit.

postcss([ require('postcss-default-unit')({unit: '%'}) ])

This plugin must be set after the plugins that can modify the values (e.g. postcss-simple-vars). See PostCSS docs for examples for your environment.

Issues

Now postcss-default-unit ignores expressions in parentheses. It won't mess up your rgba or calc, but it won't also add a unit to your gradient.

Keywords

postcss

FAQs

Package last updated on 12 Oct 2022

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