postcss-pseudo-class-any-link
Use the proposed :any-link pseudo-class in CSS
Last updated 10 years ago by jonathantneal .
CC0-1.0 · Repository · Bugs · Original npm · Tarball · package.json
$ gnpm install postcss-pseudo-class-any-link 
SYNC missed versions from official npm registry.

PostCSS Pseudo Class Any Link PostCSS Logo

npm version CSS Standard Status Build Status Discord

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

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:

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

Use it as a PostCSS plugin:

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

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

PostCSS Pseudo Class Any Link runs in all Node environments, with special instructions for:

Options

preserve

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

postcssPseudoClassAnyLink({ preserve: false })
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.
In IE and Edge these do not match :link or :visited.

This increased CSS bundle size and is disabled by default.

postcssPseudoClassAnyLink({
	subFeatures: {
		areaHrefNeedsFixing: true
	}
})
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;
}

Current Tags

  • 8.0.2                                ...           latest (2 years ago)

23 Versions

  • 8.0.2                                ...           2 years ago
  • 8.0.1                                ...           2 years ago
  • 8.0.0                                ...           2 years ago
  • 7.1.6                                ...           3 years ago
  • 7.1.5                                ...           3 years ago
  • 7.1.4                                ...           3 years ago
  • 7.1.3                                ...           3 years ago
  • 7.1.2                                ...           3 years ago
  • 7.1.1                                ...           3 years ago
  • 7.1.0                                ...           3 years ago
  • 7.0.2                                ...           3 years ago
  • 7.0.1                                ...           3 years ago
  • 7.0.0                                ...           3 years ago
  • 6.0.0                                ...           6 years ago
  • 5.0.0                                ...           7 years ago
  • 4.0.0                                ...           8 years ago
  • 3.0.1                                ...           8 years ago
  • 3.0.0                                ...           8 years ago
  • 1.0.0                                ...           9 years ago
  • 0.3.0                                ...           10 years ago
  • 0.2.1                                ...           10 years ago
  • 0.2.0                                ...           10 years ago
  • 0.1.0                                ...           10 years ago
Downloads
Today 0
This Week 0
This Month 43
Last Day 0
Last Week 43
Last Month 0
Dependencies (1)
Dev Dependencies (5)

Copyright 2013 - present © cnpmjs.org | Home |