Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

před 3 roky
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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. [![NPM Version][npm-img]][npm-url]
  3. [![CSS Standard Status][css-img]][css-url]
  4. [![Build Status][cli-img]][cli-url]
  5. [![Support Chat][git-img]][git-url]
  6. [PostCSS Pseudo Class Any Link] lets you `:any-link` pseudo-class in CSS,
  7. following the [Selectors] specification.
  8. ```pcss
  9. nav :any-link > span {
  10. background-color: yellow;
  11. }
  12. /* becomes */
  13. nav :link > span, nav :visited > span {
  14. background-color: yellow;
  15. }
  16. nav :any-link > span {
  17. background-color: yellow;
  18. }
  19. ```
  20. From the [proposal][Selectors]:
  21. > The `:any-link` pseudo-class represents an element that acts as the source
  22. anchor of a hyperlink. It matches an element if the element would match
  23. `:link` or `:visited`.
  24. ## Usage
  25. Add [PostCSS Pseudo Class Any Link] to your project:
  26. ```bash
  27. npm install postcss-pseudo-class-any-link --save-dev
  28. ```
  29. Use [PostCSS Pseudo Class Any Link] to process your CSS:
  30. ```js
  31. const postcssPseudoClassAnyLink = require('postcss-pseudo-class-any-link');
  32. postcssPseudoClassAnyLink.process(YOUR_CSS /*, processOptions, pluginOptions */);
  33. ```
  34. Or use it as a [PostCSS] plugin:
  35. ```js
  36. const postcss = require('postcss');
  37. const postcssPseudoClassAnyLink = require('postcss-pseudo-class-any-link');
  38. postcss([
  39. postcssPseudoClassAnyLink(/* pluginOptions */)
  40. ]).process(YOUR_CSS /*, processOptions */);
  41. ```
  42. [PostCSS Pseudo Class Any Link] runs in all Node environments, with special
  43. instructions for:
  44. | [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) |
  45. | --- | --- | --- | --- | --- | --- |
  46. ## Options
  47. ### preserve
  48. The `preserve` option determines whether the original `:any-link` rule is
  49. preserved. By default, it is preserved.
  50. ```js
  51. postcssPseudoClassAnyLink({ preserve: false })
  52. ```
  53. ```pcss
  54. nav :any-link > span {
  55. background-color: yellow;
  56. }
  57. /* becomes */
  58. nav :link > span, nav :visited > span {
  59. background-color: yellow;
  60. }
  61. ```
  62. [cli-img]: https://img.shields.io/travis/jonathantneal/postcss-pseudo-class-any-link.svg
  63. [cli-url]: https://travis-ci.org/jonathantneal/postcss-pseudo-class-any-link
  64. [css-img]: https://cssdb.org/badge/any-link-pseudo-class.svg
  65. [css-url]: https://cssdb.org/#any-link-pseudo-class
  66. [git-img]: https://img.shields.io/badge/support-chat-blue.svg
  67. [git-url]: https://gitter.im/postcss/postcss
  68. [npm-img]: https://img.shields.io/npm/v/postcss-pseudo-class-any-link.svg
  69. [npm-url]: https://www.npmjs.com/package/postcss-pseudo-class-any-link
  70. [Gulp PostCSS]: https://github.com/postcss/gulp-postcss
  71. [Grunt PostCSS]: https://github.com/nDmitry/grunt-postcss
  72. [PostCSS]: https://github.com/postcss/postcss
  73. [PostCSS Loader]: https://github.com/postcss/postcss-loader
  74. [PostCSS Pseudo Class Any Link]: https://github.com/jonathantneal/postcss-pseudo-class-any-link
  75. [Selectors]: https://www.w3.org/TR/selectors-4/#the-any-link-pseudo