# postcss-pseudo-class-any-link

> Use the :any-link pseudo-class in CSS

Latest version **11.0.0** (published 2026-01-14) · MIT-0 license · 0 weekly downloads

## Install

```sh
npm install postcss-pseudo-class-any-link
pnpm add postcss-pseudo-class-any-link
yarn add postcss-pseudo-class-any-link
bun add postcss-pseudo-class-any-link
```

## Health

**Score 55/100 (C)** — status: stable.

Positive: esm support; no vulnerabilities; high maintenance score.

Warnings: low downloads; no types.

## Facts

| | |
|---|---|
| Version | 11.0.0 |
| Published | 2026-01-14 |
| First published | 2015-06-15 |
| Weekly downloads | 0 |
| License | MIT-0 |
| TypeScript types | none |
| Module format | ESM |
| Node | >=20.19.0 |
| Dependencies | 1 |
| Unpacked size | 8.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1052 |
| Maintainers | jonathantneal, alaguna, romainmenke |
| Keywords | a, any-link, area, css, href, hyperlink, link, postcss, postcss-plugin, visited |

## Links

- npm: https://www.npmjs.com/package/postcss-pseudo-class-any-link
- Repository: https://github.com/csstools/postcss-plugins
- Homepage: https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-pseudo-class-any-link#readme
- Issues: https://github.com/csstools/postcss-plugins/issues
- Funding: https://github.com/sponsors/csstools
- npm.io page: https://npm.io/package/postcss-pseudo-class-any-link

## Dependencies (1)

- [postcss-selector-parser](https://npm.io/package/postcss-selector-parser.md) ^7.1.1

## Alternatives

- [update-check](https://npm.io/package/update-check.md) — 4.0M weekly downloads
- [react-native-onesignal](https://npm.io/package/react-native-onesignal.md) — 134.5K weekly downloads
- [react-redux-toastr](https://npm.io/package/react-redux-toastr.md) — 33.7K weekly downloads
- [@nocobase/plugin-notification-manager](https://npm.io/package/@nocobase/plugin-notification-manager.md) — 2.0K weekly downloads
- [react-simple-toasts](https://npm.io/package/react-simple-toasts.md) — 1.9K weekly downloads

## Recent versions

- 11.0.0 (latest) — 2026-01-14
- 10.0.1 — 2024-10-23
- 10.0.0 — 2024-08-03
- 9.0.2 — 2024-04-21
- 9.0.1 — 2023-12-15
- 9.0.0 — 2023-07-03
- 8.0.2 — 2023-02-09
- 8.0.1 — 2023-01-28
- 8.0.0 — 2023-01-24
- 7.1.6 — 2022-07-08
- 7.1.5 — 2022-06-23
- 7.1.4 — 2022-05-17
- 7.1.3 — 2022-05-06
- 7.1.2 — 2022-04-04
- 7.1.1 — 2022-02-05
- … 14 more at https://npm.io/package/postcss-pseudo-class-any-link/versions

## README

# PostCSS Pseudo Class Any Link [<img src="https://postcss.github.io/postcss/logo.svg" alt="PostCSS Logo" width="90" height="90" align="right">][PostCSS]

`npm install postcss-pseudo-class-any-link --save-dev`

[PostCSS Pseudo Class Any Link] lets you `:any-link` pseudo-class in CSS,
following the [Selectors] specification.

```css
nav :any-link > span {
	background-color: yellow;
}

/* becomes */

nav :link > span, nav :visited > span {
	background-color: yellow;
}
nav :any-link > span {
	background-color: yellow;
}
```

## Usage

Add [PostCSS Pseudo Class Any Link] to your project:

```bash
npm install postcss postcss-pseudo-class-any-link --save-dev
```

Use it as a [PostCSS] plugin:

```js
const postcss = require('postcss');
const postcssPseudoClassAnyLink = require('postcss-pseudo-class-any-link');

postcss([
	postcssPseudoClassAnyLink(/* pluginOptions */)
]).process(YOUR_CSS /*, processOptions */);
```



## Options

### preserve

The `preserve` option determines whether the original notation
is preserved. By default, it is preserved.

```js
postcssPseudoClassAnyLink({ preserve: false })
```

```css
nav :any-link > span {
	background-color: yellow;
}

/* becomes */

nav :link > span, nav :visited > span {
	background-color: yellow;
}
```

### subFeatures

#### areaHrefNeedsFixing

The `subFeatures.areaHrefNeedsFixing` option determines if `<area href>` elements should match `:any-link` pseudo-class.<br>
In IE and Edge these do not match `:link` or `:visited`.

_This increased CSS bundle size and is disabled by default._

```js
postcssPseudoClassAnyLink({
	subFeatures: {
		areaHrefNeedsFixing: true
	}
})
```

```css
nav :any-link > span {
	background-color: yellow;
}

/* becomes */

nav :link > span, nav :visited > span, nav area[href] > span {
	background-color: yellow;
}
nav :any-link > span {
	background-color: yellow;
}
```

[cli-url]: https://github.com/csstools/postcss-plugins/actions/workflows/test.yml?query=workflow/test
[css-url]: https://cssdb.org/#any-link-pseudo-class
[discord]: https://discord.gg/bUadyRwkJS
[npm-url]: https://www.npmjs.com/package/postcss-pseudo-class-any-link

[PostCSS]: https://github.com/postcss/postcss
[PostCSS Pseudo Class Any Link]: https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-pseudo-class-any-link
[Selectors]: https://www.w3.org/TR/selectors-4/#the-any-link-pseudo

---
_Source: https://npm.io/package/postcss-pseudo-class-any-link · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
