Skip to content

Latest commit

 

History

History
33 lines (25 loc) · 623 Bytes

unitless.md

File metadata and controls

33 lines (25 loc) · 623 Bytes

unitless Addon

When a style declarations accepts a single numeric value with a unit, in nano-css you have to specify that as a string.

nano.rule('.foo', {
    width: '50px'
});

This addon allows you to use numbers instead, it will postfix every numeric property that requires a unit with px. Properties that don't need a unit will remain unitless.

nano.rule('.foo', {
    width: 50,
    zIndex: 10
});

Result:

.foo {
    width: 50px;
    z-index: 10;
}

Installation

Simply install unitless addon. Read more about the Addon Installation.