# @jetbrains/postcss-require-hover

> PostCSS plugin that wraps hover selectors in a media media that's only valid on devices that support true hover events.

Latest version **0.2.0** (published 2025-06-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install @jetbrains/postcss-require-hover
pnpm add @jetbrains/postcss-require-hover
yarn add @jetbrains/postcss-require-hover
bun add @jetbrains/postcss-require-hover
```

## Health

**Score 25/100 (F)** — status: maintenance-mode.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2025-06-16 |
| First published | 2018-10-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 5.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6 |
| Author | Jack Burns |
| Maintainers | jetbrains-admin, kotlin, jetbrains-buildserver, allvo, bashor, skoch13 |
| Keywords | postcss, css, postcss-plugin, hover |

## Links

- npm: https://www.npmjs.com/package/@jetbrains/postcss-require-hover
- Repository: https://github.com/jackburns/postcss-require-hover
- Issues: https://github.com/jackburns/postcss-require-hover/issues
- npm.io page: https://npm.io/package/@jetbrains/postcss-require-hover

## Alternatives

- [style-dictionary](https://npm.io/package/style-dictionary.md) — 2.0M weekly downloads
- [postcss-merge-idents](https://npm.io/package/postcss-merge-idents.md) — 1.7M weekly downloads
- [@fontsource/noto-sans](https://npm.io/package/@fontsource/noto-sans.md) — 93.0K weekly downloads
- [uglifycss](https://npm.io/package/uglifycss.md) — 71.6K weekly downloads
- [mat4-interpolate](https://npm.io/package/mat4-interpolate.md) — 23.3K weekly downloads

## Recent versions

- 0.2.0 (latest) — 2025-06-16
- 0.1.3 — 2024-12-02
- 0.1.2 — 2018-10-03
- 0.1.1 — 2018-10-02

## README

# PostCSS Require Hover

[postcss]: https://github.com/postcss/postcss

[PostCSS] plugin that wraps hover selectors in a media media that's only valid on devices that support true hover events. The goal of this plugin is to prevent mobile browsers (mostly iOS) from getting their hover states "stuck" since hover.

Original idea: https://www.quirksmode.org/blog/archives/2012/11/what_the_hells.html

More explicit support for this feature: https://drafts.csswg.org/mediaqueries/#hover

Tested:

-   IE11
-   Chrome
-   Safari
-   Firefox
-   iOS - Safari/Chrome
-   Android - Chrome

## Example

```css
.foo {
    bar:hover {
        display: block;
    }
}
```

```css
.foo {
    @media (hover: hover), (-moz-touch-enabled: 0), (-ms-high-contrast: none), (-ms-high-contrast: active) {
        bar:hover {
            display: block;
        }
    }
}
```

## Installation

```
npm install postcss postcss-require-hover
```

## Usage

```js
postcss([require("postcss-require-hover")]);
```

See [PostCSS] docs for examples for your environment.

---
_Source: https://npm.io/package/@jetbrains/postcss-require-hover · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
