New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

postcss-media-hover-fix

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postcss-media-hover-fix

PostCSS plugin to fix hover media queries for better touch device support

latest
Source
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

postcss-media-hover-fix

A PostCSS plugin that fixes hover media queries for better touch device support.

Description

This plugin automatically wraps CSS hover selectors in a media query that checks for both hover capability and fine pointer input. This ensures that hover effects only apply on devices that actually support hover, preventing unwanted hover effects on touch devices.

Installation

npm install postcss-media-hover-fix --save-dev

Usage

Add the plugin to your PostCSS configuration:

// postcss.config.js
module.exports = {
  plugins: [
    require('postcss-media-hover-fix')
  ]
}

Example

Input:

.button:hover {
  background-color: blue;
}

Output:

@media (hover: hover) and (pointer: fine) {
  .button:hover {
    background-color: blue;
  }
}

Credits

  • Original plugin author: Saul Hardman hello@iamsaul.co.uk github plugin
  • Modified by: Hwaiteu github

License

MIT

Keywords

postcss

FAQs

Package last updated on 11 Apr 2025

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