Socket
Socket
Sign inDemoInstall

postcss-nested

Package Overview
Dependencies
Maintainers
1
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postcss-nested

PostCSS plugin to unwrap nested rules like how Sass does it


Version published
Weekly downloads
10M
increased by3.62%
Maintainers
1
Weekly downloads
 
Created

What is postcss-nested?

The postcss-nested npm package allows developers to use nested syntax in CSS, similar to what is possible in preprocessors like SASS and LESS. It processes CSS files and unwraps nested rules following the CSS Nesting specification. This makes the CSS more readable and maintainable by organizing styles in a hierarchical manner.

What are postcss-nested's main functionalities?

Nesting Rules

This feature allows you to nest hover and other pseudo-class selectors inside the main selector block, making the CSS structure more intuitive and easier to manage.

a {
  color: red;
  &:hover {
    color: green;
  }
}

Nesting Properties

Enables grouping of properties under a common namespace, which can be particularly useful for font, margin, and padding definitions, leading to a cleaner and more organized style definition.

a {
  font: {
    weight: bold;
    size: 14px;
    family: Arial, sans-serif;
  }
}

Nesting At-Rules

Supports nesting of at-rules like @media, allowing for more streamlined and readable media query definitions within the relevant selector context.

@media (min-width: 768px) {
  body {
    background: lightblue;
    a {
      color: navy;
    }
  }
}

Other packages similar to postcss-nested

Keywords

FAQs

Package last updated on 19 Jul 2024

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