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

@csstools/postcss-media-minmax

Package Overview
Dependencies
Maintainers
0
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@csstools/postcss-media-minmax

Use the range notation in CSS media queries

  • 2.0.4
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.3M
increased by2.57%
Maintainers
0
Weekly downloads
 
Created

What is @csstools/postcss-media-minmax?

@csstools/postcss-media-minmax is a PostCSS plugin that allows you to use the `<=` and `>=` operators in CSS media queries. This simplifies the syntax for writing media queries and makes them more readable.

What are @csstools/postcss-media-minmax's main functionalities?

Using `<=` in media queries

This feature allows you to use the `<=` operator in media queries, which is transformed into the equivalent `max-width` query.

/* Input CSS */
@media (width <= 600px) {
  .example {
    background: red;
  }
}

/* Output CSS */
@media (max-width: 600px) {
  .example {
    background: red;
  }
}

Using `>=` in media queries

This feature allows you to use the `>=` operator in media queries, which is transformed into the equivalent `min-width` query.

/* Input CSS */
@media (width >= 800px) {
  .example {
    background: blue;
  }
}

/* Output CSS */
@media (min-width: 800px) {
  .example {
    background: blue;
  }
}

Combining `<=` and `>=` in media queries

This feature allows you to combine `<=` and `>=` operators in a single media query, which is transformed into the equivalent `min-width` and `max-width` query.

/* Input CSS */
@media (400px <= width <= 800px) {
  .example {
    background: green;
  }
}

/* Output CSS */
@media (min-width: 400px) and (max-width: 800px) {
  .example {
    background: green;
  }
}

Other packages similar to @csstools/postcss-media-minmax

Keywords

FAQs

Package last updated on 01 Nov 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