source: frontend/node_modules/postcss-pseudo-class-any-link/README.md

Last change on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 12 days ago

Fix frontend appearance

  • Property mode set to 100644
File size: 3.5 KB
Line 
1# PostCSS Pseudo Class Any Link [<img src="https://postcss.github.io/postcss/logo.svg" alt="PostCSS Logo" width="90" height="90" align="right">][postcss]
2
3[![NPM Version][npm-img]][npm-url]
4[![CSS Standard Status][css-img]][css-url]
5[![Build Status][cli-img]][cli-url]
6[<img alt="Discord" src="https://shields.io/badge/Discord-5865F2?logo=discord&logoColor=white">][discord]
7
8[PostCSS Pseudo Class Any Link] lets you `:any-link` pseudo-class in CSS,
9following the [Selectors] specification.
10
11```pcss
12nav :any-link > span {
13 background-color: yellow;
14}
15
16/* becomes */
17
18nav :link > span, nav :visited > span {
19 background-color: yellow;
20}
21
22nav :any-link > span {
23 background-color: yellow;
24}
25```
26
27From the [proposal][Selectors]:
28
29> The `:any-link` pseudo-class represents an element that acts as the source
30 anchor of a hyperlink. It matches an element if the element would match
31 `:link` or `:visited`.
32
33[!['Can I use' table](https://caniuse.bitsofco.de/image/css-any-link.png)](https://caniuse.com/#feat=css-any-link)
34
35## Usage
36
37Add [PostCSS Pseudo Class Any Link] to your project:
38
39```bash
40npm install postcss postcss-pseudo-class-any-link --save-dev
41```
42
43Use [PostCSS Pseudo Class Any Link] as a [PostCSS] plugin:
44
45```js
46const postcss = require('postcss');
47const postcssPseudoClassAnyLink = require('postcss-pseudo-class-any-link');
48
49postcss([
50 postcssPseudoClassAnyLink(/* pluginOptions */)
51]).process(YOUR_CSS /*, processOptions */);
52```
53
54[PostCSS Pseudo Class Any Link] runs in all Node environments, with special
55instructions for:
56
57| [Node](INSTALL.md#node) | [PostCSS CLI](INSTALL.md#postcss-cli) | [Webpack](INSTALL.md#webpack) | [Create React App](INSTALL.md#create-react-app) | [Gulp](INSTALL.md#gulp) | [Grunt](INSTALL.md#grunt) |
58| --- | --- | --- | --- | --- | --- |
59
60## Options
61
62### preserve
63
64The `preserve` option determines whether the original `:any-link` rule is
65preserved. By default, it is preserved.
66
67```js
68postcssPseudoClassAnyLink({ preserve: false })
69```
70
71```pcss
72nav :any-link > span {
73 background-color: yellow;
74}
75
76/* becomes */
77
78nav :link > span, nav :visited > span {
79 background-color: yellow;
80}
81```
82
83### subFeatures
84
85#### areaHrefNeedsFixing
86
87The `subFeatures.areaHrefNeedsFixing` option determines if `<area href>` elements should match `:any-link` pseudo-class.<br>
88In IE and Edge these do not match `:link` or `:visited`.
89
90_This increased CSS bundle size and is disabled by default._
91
92```js
93postcssPseudoClassAnyLink({
94 subFeatures: {
95 areaHrefNeedsFixing: true
96 }
97})
98```
99
100```pcss
101nav :any-link > span {
102 background-color: yellow;
103}
104
105/* becomes */
106
107nav :link > span, nav :visited > span, area[href] > span {
108 background-color: yellow;
109}
110```
111
112[cli-img]: https://github.com/csstools/postcss-plugins/workflows/test/badge.svg
113[cli-url]: https://github.com/csstools/postcss-plugins/actions/workflows/test.yml?query=workflow/test
114[css-img]: https://cssdb.org/images/badges/any-link-pseudo-class.svg
115[css-url]: https://cssdb.org/#any-link-pseudo-class
116[discord]: https://discord.gg/bUadyRwkJS
117[npm-img]: https://img.shields.io/npm/v/postcss-pseudo-class-any-link.svg
118[npm-url]: https://www.npmjs.com/package/postcss-pseudo-class-any-link
119
120[Gulp PostCSS]: https://github.com/postcss/gulp-postcss
121[Grunt PostCSS]: https://github.com/nDmitry/grunt-postcss
122[PostCSS]: https://github.com/postcss/postcss
123[PostCSS Loader]: https://github.com/postcss/postcss-loader
124[PostCSS Pseudo Class Any Link]: https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-pseudo-class-any-link
125[Selectors]: https://www.w3.org/TR/selectors-4/#the-any-link-pseudo
Note: See TracBrowser for help on using the repository browser.