Socket
Socket
Sign inDemoInstall

postcss-nested-props

Package Overview
Dependencies
13
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    postcss-nested-props

PostCSS plugin to unwrap nested properties.


Version published
Weekly downloads
173
increased by2.37%
Maintainers
1
Install size
1.43 MB
Created
Weekly downloads
 

Changelog

Source

1.1.7

  • Fix module resolution (#26).

Readme

Source

postcss-nested-props

NPM version npm license Travis Build Status codecov CircleCI

npm

PostCSS plugin to unwrap nested properties.

Nested Properties

CSS has quite a few properties that are in “namespaces;” for instance, font-family, font-size, and font-weight are all in the font namespace. In CSS, if you want to set a bunch of properties in the same namespace, you have to type it out each time. This plugin provides a shortcut: just write the namespace once, then nest each of the sub-properties within it. For example:

.funky {
  font: {
    family: fantasy;
    size: 30em;
    weight: bold;
  }
}

is compiled to:

.funky {
  font-family: fantasy;
  font-size: 30em;
  font-weight: bold;
}

The property namespace itself can also have a value. For example:

.funky {
  font: 20px/24px fantasy {
    weight: bold;
  }
}

is compiled to:

.funky {
  font: 20px/24px fantasy;
  font-weight: bold;
}

For nested rules, use the postcss-nested plugin, but make sure to run it after this one.

Installation

$ npm install postcss-nested-props

Usage

JavaScript

postcss([ require('postcss-nested-props') ]);

TypeScript

import * as postcssNestedProps from 'postcss-nested-props';

postcss([ postcssNestedProps ]);

Options

None at this time.

Keywords

FAQs

Last updated on 24 Feb 2017

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc