Socket
Socket
Sign inDemoInstall

postcss-custom-media

Package Overview
Dependencies
Maintainers
1
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postcss-custom-media

PostCSS plugin to transform W3C CSS Custom Media Queries to more compatible CSS


Version published
Weekly downloads
5.4M
decreased by-7.1%
Maintainers
1
Weekly downloads
 
Created

What is postcss-custom-media?

The postcss-custom-media package allows you to define custom media queries in CSS, which can then be reused throughout your stylesheets. This helps in maintaining a consistent and DRY (Don't Repeat Yourself) approach to media queries.

What are postcss-custom-media's main functionalities?

Define Custom Media Queries

This feature allows you to define custom media queries using the @custom-media rule. In this example, a custom media query named --small-viewport is defined for viewports with a maximum width of 30em.

@custom-media --small-viewport (max-width: 30em);

Use Custom Media Queries

Once a custom media query is defined, it can be used in your CSS just like any other media query. In this example, the custom media query --small-viewport is used to change the text color to red for small viewports.

body { color: black; }
@media (--small-viewport) { body { color: red; } }

Other packages similar to postcss-custom-media

Keywords

FAQs

Package last updated on 29 Jan 2015

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