postcss-pseudo-class-any-link
Advanced tools
Comparing version 4.0.0 to 5.0.0
@@ -1,3 +0,9 @@ | ||
# Changes to :any-link | ||
# Changes to PostCSS Pseudo Class Any Link | ||
### 5.0.0 (May 7, 2018) | ||
- Updated: `postcss-selector-parser` to v4.0.0 (major) | ||
- Updated: `postcss` to v6.0.22 (patch) | ||
- Changed: Preserves `:any-link` by default | ||
### 4.0.0 (May 10, 2017) | ||
@@ -4,0 +10,0 @@ |
138
LICENSE.md
@@ -30,78 +30,80 @@ # CC0 1.0 Universal | ||
1. Copyright and Related Rights. A Work made available under CC0 may be | ||
protected by copyright and related or neighboring rights (“Copyright and | ||
Related Rights”). Copyright and Related Rights include, but are not limited | ||
to, the following: | ||
1. the right to reproduce, adapt, distribute, perform, display, | ||
communicate, and translate a Work; | ||
2. moral rights retained by the original author(s) and/or performer(s); | ||
3. publicity and privacy rights pertaining to a person’s image or likeness | ||
depicted in a Work; | ||
4. rights protecting against unfair competition in regards to a Work, | ||
subject to the limitations in paragraph 4(i), below; | ||
5. rights protecting the extraction, dissemination, use and reuse of data | ||
in a Work; | ||
6. database rights (such as those arising under Directive 96/9/EC of the | ||
European Parliament and of the Council of 11 March 1996 on the legal | ||
protection of databases, and under any national implementation thereof, | ||
including any amended or successor version of such directive); and | ||
7. other similar, equivalent or corresponding rights throughout the world | ||
based on applicable law or treaty, and any national implementations | ||
thereof. | ||
protected by copyright and related or neighboring rights (“Copyright and | ||
Related Rights”). Copyright and Related Rights include, but are not limited | ||
to, the following: | ||
1. the right to reproduce, adapt, distribute, perform, display, communicate, | ||
and translate a Work; | ||
2. moral rights retained by the original author(s) and/or performer(s); | ||
3. publicity and privacy rights pertaining to a person’s image or likeness | ||
depicted in a Work; | ||
4. rights protecting against unfair competition in regards to a Work, | ||
subject to the limitations in paragraph 4(i), below; | ||
5. rights protecting the extraction, dissemination, use and reuse of data in | ||
a Work; | ||
6. database rights (such as those arising under Directive 96/9/EC of the | ||
European Parliament and of the Council of 11 March 1996 on the legal | ||
protection of databases, and under any national implementation thereof, | ||
including any amended or successor version of such directive); and | ||
7. other similar, equivalent or corresponding rights throughout the world | ||
based on applicable law or treaty, and any national implementations | ||
thereof. | ||
2. Waiver. To the greatest extent permitted by, but not in contravention of, | ||
applicable law, Affirmer hereby overtly, fully, permanently, irrevocably and | ||
unconditionally waives, abandons, and surrenders all of Affirmer’s Copyright | ||
and Related Rights and associated claims and causes of action, whether now | ||
known or unknown (including existing as well as future claims and causes of | ||
action), in the Work (i) in all territories worldwide, (ii) for the maximum | ||
duration provided by applicable law or treaty (including future time | ||
extensions), (iii) in any current or future medium and for any number of | ||
copies, and (iv) for any purpose whatsoever, including without limitation | ||
commercial, advertising or promotional purposes (the “Waiver”). Affirmer makes | ||
the Waiver for the benefit of each member of the public at large and to the | ||
detriment of Affirmer’s heirs and successors, fully intending that such Waiver | ||
shall not be subject to revocation, rescission, cancellation, termination, or | ||
any other legal or equitable action to disrupt the quiet enjoyment of the Work | ||
by the public as contemplated by Affirmer’s express Statement of Purpose. | ||
applicable law, Affirmer hereby overtly, fully, permanently, irrevocably and | ||
unconditionally waives, abandons, and surrenders all of Affirmer’s Copyright | ||
and Related Rights and associated claims and causes of action, whether now | ||
known or unknown (including existing as well as future claims and causes of | ||
action), in the Work (i) in all territories worldwide, (ii) for the maximum | ||
duration provided by applicable law or treaty (including future time | ||
extensions), (iii) in any current or future medium and for any number of | ||
copies, and (iv) for any purpose whatsoever, including without limitation | ||
commercial, advertising or promotional purposes (the “Waiver”). Affirmer | ||
makes the Waiver for the benefit of each member of the public at large and | ||
to the detriment of Affirmer’s heirs and successors, fully intending that | ||
such Waiver shall not be subject to revocation, rescission, cancellation, | ||
termination, or any other legal or equitable action to disrupt the quiet | ||
enjoyment of the Work by the public as contemplated by Affirmer’s express | ||
Statement of Purpose. | ||
3. Public License Fallback. Should any part of the Waiver for any reason be | ||
judged legally invalid or ineffective under applicable law, then the Waiver | ||
shall be preserved to the maximum extent permitted taking into account | ||
Affirmer’s express Statement of Purpose. In addition, to the extent the Waiver | ||
is so judged Affirmer hereby grants to each affected person a royalty-free, non | ||
transferable, non sublicensable, non exclusive, irrevocable and unconditional | ||
license to exercise Affirmer’s Copyright and Related Rights in the Work (i) in | ||
all territories worldwide, (ii) for the maximum duration provided by applicable | ||
law or treaty (including future time extensions), (iii) in any current or | ||
future medium and for any number of copies, and (iv) for any purpose | ||
whatsoever, including without limitation commercial, advertising or promotional | ||
purposes (the “License”). The License shall be deemed effective as of the date | ||
CC0 was applied by Affirmer to the Work. Should any part of the License for any | ||
reason be judged legally invalid or ineffective under applicable law, such | ||
partial invalidity or ineffectiveness shall not invalidate the remainder of the | ||
License, and in such case Affirmer hereby affirms that he or she will not (i) | ||
exercise any of his or her remaining Copyright and Related Rights in the Work | ||
or (ii) assert any associated claims and causes of action with respect to the | ||
Work, in either case contrary to Affirmer’s express Statement of Purpose. | ||
judged legally invalid or ineffective under applicable law, then the Waiver | ||
shall be preserved to the maximum extent permitted taking into account | ||
Affirmer’s express Statement of Purpose. In addition, to the extent the | ||
Waiver is so judged Affirmer hereby grants to each affected person a | ||
royalty-free, non transferable, non sublicensable, non exclusive, | ||
irrevocable and unconditional license to exercise Affirmer’s Copyright and | ||
Related Rights in the Work (i) in all territories worldwide, (ii) for the | ||
maximum duration provided by applicable law or treaty (including future time | ||
extensions), (iii) in any current or future medium and for any number of | ||
copies, and (iv) for any purpose whatsoever, including without limitation | ||
commercial, advertising or promotional purposes (the “License”). The License | ||
shall be deemed effective as of the date CC0 was applied by Affirmer to the | ||
Work. Should any part of the License for any reason be judged legally | ||
invalid or ineffective under applicable law, such partial invalidity or | ||
ineffectiveness shall not invalidate the remainder of the License, and in | ||
such case Affirmer hereby affirms that he or she will not (i) exercise any | ||
of his or her remaining Copyright and Related Rights in the Work or (ii) | ||
assert any associated claims and causes of action with respect to the Work, | ||
in either case contrary to Affirmer’s express Statement of Purpose. | ||
4. Limitations and Disclaimers. | ||
1. No trademark or patent rights held by Affirmer are waived, abandoned, | ||
surrendered, licensed or otherwise affected by this document. | ||
2. Affirmer offers the Work as-is and makes no representations or | ||
warranties of any kind concerning the Work, express, implied, statutory | ||
or otherwise, including without limitation warranties of title, | ||
merchantability, fitness for a particular purpose, non infringement, or | ||
the absence of latent or other defects, accuracy, or the present or | ||
absence of errors, whether or not discoverable, all to the greatest | ||
extent permissible under applicable law. | ||
3. Affirmer disclaims responsibility for clearing rights of other persons | ||
that may apply to the Work or any use thereof, including without | ||
limitation any person’s Copyright and Related Rights in the Work. | ||
Further, Affirmer disclaims responsibility for obtaining any necessary | ||
consents, permissions or other rights required for any use of the Work. | ||
4. Affirmer understands and acknowledges that Creative Commons is not a | ||
party to this document and has no duty or obligation with respect to | ||
this CC0 or use of the Work. | ||
1. No trademark or patent rights held by Affirmer are waived, abandoned, | ||
surrendered, licensed or otherwise affected by this document. | ||
2. Affirmer offers the Work as-is and makes no representations or warranties | ||
of any kind concerning the Work, express, implied, statutory or | ||
otherwise, including without limitation warranties of title, | ||
merchantability, fitness for a particular purpose, non infringement, or | ||
the absence of latent or other defects, accuracy, or the present or | ||
absence of errors, whether or not discoverable, all to the greatest | ||
extent permissible under applicable law. | ||
3. Affirmer disclaims responsibility for clearing rights of other persons | ||
that may apply to the Work or any use thereof, including without | ||
limitation any person’s Copyright and Related Rights in the Work. | ||
Further, Affirmer disclaims responsibility for obtaining any necessary | ||
consents, permissions or other rights required for any use of the Work. | ||
4. Affirmer understands and acknowledges that Creative Commons is not a | ||
party to this document and has no duty or obligation with respect to this | ||
CC0 or use of the Work. | ||
For more information, please see | ||
http://creativecommons.org/publicdomain/zero/1.0/. |
{ | ||
"name": "postcss-pseudo-class-any-link", | ||
"version": "4.0.0", | ||
"description": "Use the proposed :any-link pseudo-class in CSS", | ||
"version": "5.0.0", | ||
"description": "Use the :any-link pseudo-class in CSS", | ||
"author": "Jonathan Neal <jonathantneal@hotmail.com>", | ||
@@ -10,11 +10,14 @@ "license": "CC0-1.0", | ||
"bugs": "https://github.com/jonathantneal/postcss-pseudo-class-any-link/issues", | ||
"main": "index.js", | ||
"main": "index.cjs.js", | ||
"module": "index.es.js", | ||
"files": [ | ||
"index.js" | ||
"index.cjs.js", | ||
"index.es.js" | ||
], | ||
"scripts": { | ||
"clean": "git clean -X -d -f", | ||
"prepublish": "npm test", | ||
"prepublishOnly": "npm test", | ||
"pretest": "rollup -c .rollup.js --silent", | ||
"test": "echo 'Running tests...'; npm run test:js && npm run test:tape", | ||
"test:js": "eslint *.js --cache --ignore-pattern .gitignore", | ||
"test:ec": "echint --ignore index.*.js test", | ||
"test:js": "eslint *.js --cache --ignore-path .gitignore --quiet", | ||
"test:tape": "postcss-tape" | ||
@@ -26,16 +29,19 @@ }, | ||
"dependencies": { | ||
"postcss": "^6.0.1", | ||
"postcss-selector-parser": "^2.2.3" | ||
"postcss": "^6.0.22", | ||
"postcss-selector-parser": "^4.0.0" | ||
}, | ||
"devDependencies": { | ||
"eslint": "^3.19.0", | ||
"eslint-config-dev": "2.0.0", | ||
"postcss-tape": "2.0.1", | ||
"pre-commit": "^1.2.2" | ||
"babel-core": "^6.26.3", | ||
"babel-eslint": "^8.2.3", | ||
"babel-preset-env": "^1.6.1", | ||
"eslint": "^4.19.1", | ||
"eslint-config-dev": "^2.0.0", | ||
"postcss-tape": "^2.2.0", | ||
"pre-commit": "^1.2.2", | ||
"rollup": "^0.58.2", | ||
"rollup-plugin-babel": "^3.0.4" | ||
}, | ||
"eslintConfig": { | ||
"extends": "dev", | ||
"parserOptions": { | ||
"sourceType": "module" | ||
} | ||
"parser": "babel-eslint" | ||
}, | ||
@@ -42,0 +48,0 @@ "keywords": [ |
176
README.md
@@ -1,16 +0,15 @@ | ||
# :any-link [<img src="https://postcss.github.io/postcss/logo.svg" alt="PostCSS Logo" width="90" height="90" align="right">][postcss] | ||
# 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 Version][npm-img]][npm-url] | ||
[![CSS Standard Status][css-img]][css-url] | ||
[![Build Status][cli-img]][cli-url] | ||
[![Licensing][lic-img]][lic-url] | ||
[![Changelog][log-img]][log-url] | ||
[![Gitter Chat][git-img]][git-url] | ||
[![Windows Build Status][win-img]][win-url] | ||
[![Support Chat][git-img]][git-url] | ||
[:any-link] lets you to use the proposed [`:any-link`] pseudo-class in CSS. | ||
[PostCSS Pseudo Class Any Link] lets you `:any-link` pseudo-class in CSS, | ||
following the [Selectors] specification. | ||
`:any-link` simplifies selectors targeting links, as the naming of `:link` is misleading; it specifically means unvisited links only, rather than all links. | ||
```css | ||
```pcss | ||
nav :any-link > span { | ||
background-color: yellow; | ||
background-color: yellow; | ||
} | ||
@@ -21,13 +20,19 @@ | ||
nav :link > span, nav :visited > span { | ||
background-color: yellow; | ||
background-color: yellow; | ||
} | ||
nav :any-link > span { | ||
background-color: yellow; | ||
} | ||
``` | ||
From the [proposal]: | ||
From the [proposal][Selectors]: | ||
> The [`:any-link`] pseudo-class represents an element that acts as the source anchor of a hyperlink. It matches an element if the element would match [`:link`] or [`:visited`]. | ||
> The `:any-link` pseudo-class represents an element that acts as the source | ||
anchor of a hyperlink. It matches an element if the element would match | ||
`:link` or `:visited`. | ||
## Usage | ||
Add [:any-link] to your build tool: | ||
Add [PostCSS Pseudo Class Any Link] to your build tool: | ||
@@ -40,6 +45,8 @@ ```bash | ||
Use [:any-link] to process your CSS: | ||
Use [PostCSS Pseudo Class Any Link] to process your CSS: | ||
```js | ||
require('postcss-pseudo-class-any-link').process(YOUR_CSS); | ||
import postcssPseudoClassAnyLink from 'postcss-pseudo-class-any-link'; | ||
postcssPseudoClassAnyLink.process(YOUR_CSS, /* processOptions */, /* pluginOptions */); | ||
``` | ||
@@ -55,10 +62,47 @@ | ||
Use [:any-link] as a plugin: | ||
Use [PostCSS Pseudo Class Any Link] as a plugin: | ||
```js | ||
import postcss from 'gulp-postcss'; | ||
import postcssPseudoClassAnyLink from 'postcss-pseudo-class-any-link'; | ||
postcss([ | ||
require('postcss-pseudo-class-any-link')() | ||
postcssPseudoClassAnyLink(/* pluginOptions */) | ||
]).process(YOUR_CSS); | ||
``` | ||
#### Webpack | ||
Add [PostCSS Loader] to your build tool: | ||
```bash | ||
npm install postcss-loader --save-dev | ||
``` | ||
Use [PostCSS Pseudo Class Any Link] in your Webpack configuration: | ||
```js | ||
import postcssPseudoClassAnyLink from 'postcss-pseudo-class-any-link'; | ||
module.exports = { | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.css$/, | ||
use: [ | ||
'style-loader', | ||
{ loader: 'css-loader', options: { importLoaders: 1 } }, | ||
{ loader: 'postcss-loader', options: { | ||
ident: 'postcss', | ||
plugins: () => [ | ||
postcssPseudoClassAnyLink(/* pluginOptions */) | ||
] | ||
} } | ||
] | ||
} | ||
] | ||
} | ||
} | ||
``` | ||
#### Gulp | ||
@@ -72,16 +116,15 @@ | ||
Use [:any-link] in your Gulpfile: | ||
Use [PostCSS Pseudo Class Any Link] in your Gulpfile: | ||
```js | ||
var postcss = require('gulp-postcss'); | ||
import postcss from 'gulp-postcss'; | ||
import postcssPseudoClassAnyLink from 'postcss-pseudo-class-any-link'; | ||
gulp.task('css', function () { | ||
return gulp.src('./src/*.css').pipe( | ||
postcss([ | ||
require('postcss-pseudo-class-any-link')() | ||
]) | ||
).pipe( | ||
gulp.dest('.') | ||
); | ||
}); | ||
gulp.task('css', () => gulp.src('./src/*.css').pipe( | ||
postcss([ | ||
postcssPseudoClassAnyLink(/* pluginOptions */) | ||
]) | ||
).pipe( | ||
gulp.dest('.') | ||
)); | ||
``` | ||
@@ -97,59 +140,62 @@ | ||
Use [:any-link] in your Gruntfile: | ||
Use [PostCSS Pseudo Class Any Link] in your Gruntfile: | ||
```js | ||
import postcssPseudoClassAnyLink from 'postcss-pseudo-class-any-link'; | ||
grunt.loadNpmTasks('grunt-postcss'); | ||
grunt.initConfig({ | ||
postcss: { | ||
options: { | ||
use: [ | ||
require('postcss-pseudo-class-any-link')() | ||
] | ||
}, | ||
dist: { | ||
src: '*.css' | ||
} | ||
} | ||
postcss: { | ||
options: { | ||
use: [ | ||
postcssPseudoClassAnyLink(/* pluginOptions */) | ||
] | ||
}, | ||
dist: { | ||
src: '*.css' | ||
} | ||
} | ||
}); | ||
``` | ||
### Alternatives | ||
## Options | ||
Here are a few other ways to simulate the effect of [PostCSS Pseudo-Class Any-Link]. | ||
### preserve | ||
```css | ||
/* Use @custom-selector; supported nowhere yet */ | ||
The `preserve` option determines whether the original `:any-link` rule is | ||
preserved. By default, it is preserved. | ||
@custom-selector :--any-link :link, :visited; | ||
```js | ||
postcssPseudoClassAnyLink({ preserve: false }) | ||
``` | ||
:--any-link { /* ... */ } | ||
```pcss | ||
nav :any-link > span { | ||
background-color: yellow; | ||
} | ||
/* Use :matches; supported in Firefox 4+, Chrome 12+, Opera 15+, Safari 5.1+ */ | ||
/* becomes */ | ||
:matches(:link, :visited) { /* ... */ } | ||
/* Use :link and :visited; supported everywhere */ | ||
:link, :visited { /* ... */ } | ||
nav :link > span, nav :visited > span { | ||
background-color: yellow; | ||
} | ||
``` | ||
[npm-url]: https://www.npmjs.com/package/postcss-pseudo-class-any-link | ||
[npm-img]: https://img.shields.io/npm/v/postcss-pseudo-class-any-link.svg | ||
[cli-img]: https://img.shields.io/travis/jonathantneal/postcss-pseudo-class-any-link.svg | ||
[cli-url]: https://travis-ci.org/jonathantneal/postcss-pseudo-class-any-link | ||
[cli-img]: https://img.shields.io/travis/jonathantneal/postcss-pseudo-class-any-link.svg | ||
[lic-url]: LICENSE.md | ||
[lic-img]: https://img.shields.io/npm/l/postcss-pseudo-class-any-link.svg | ||
[log-url]: CHANGELOG.md | ||
[log-img]: https://img.shields.io/badge/changelog-md-blue.svg | ||
[css-img]: https://cssdb.org/badge/any-link-pseudo-class.svg | ||
[css-url]: https://cssdb.org/#any-link-pseudo-class | ||
[git-img]: https://img.shields.io/badge/support-chat-blue.svg | ||
[git-url]: https://gitter.im/postcss/postcss | ||
[git-img]: https://img.shields.io/badge/chat-gitter-blue.svg | ||
[npm-img]: https://img.shields.io/npm/v/postcss-pseudo-class-any-link.svg | ||
[npm-url]: https://www.npmjs.com/package/postcss-pseudo-class-any-link | ||
[win-img]: https://img.shields.io/appveyor/ci/jonathantneal/postcss-pseudo-class-any-link.svg | ||
[win-url]: https://ci.appveyor.com/project/jonathantneal/postcss-pseudo-class-any-link | ||
[:any-link]: https://github.com/jonathantneal/postcss-pseudo-class-any-link | ||
[`:any-link`]: http://dev.w3.org/csswg/selectors/#any-link-pseudo | ||
[`:link`]: http://dev.w3.org/csswg/selectors/#link-pseudo | ||
[`:visited`]: http://dev.w3.org/csswg/selectors/#visited-pseudo | ||
[proposal]: http://dev.w3.org/csswg/selectors/ | ||
[PostCSS]: https://github.com/postcss/postcss | ||
[Gulp PostCSS]: https://github.com/postcss/gulp-postcss | ||
[Grunt PostCSS]: https://github.com/nDmitry/grunt-postcss | ||
[PostCSS]: https://github.com/postcss/postcss | ||
[PostCSS Loader]: https://github.com/postcss/postcss-loader | ||
[PostCSS Pseudo Class Any Link]: https://github.com/jonathantneal/postcss-pseudo-class-any-link | ||
[Selectors]: https://www.w3.org/TR/selectors-4/#the-any-link-pseudo |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
18187
6
116
197
9
+ Addedcssesc@1.0.1(transitive)
+ Addedpostcss-selector-parser@4.0.0(transitive)
- Removedflatten@1.0.3(transitive)
- Removedpostcss-selector-parser@2.2.3(transitive)
Updatedpostcss@^6.0.22