Skip to content
This repository was archived by the owner on Dec 19, 2024. It is now read-only.

Commit c46bf13

Browse files
committed
Added: :any-link pseudo class support
1 parent ded5686 commit c46bf13

File tree

11 files changed

+39
-8
lines changed

11 files changed

+39
-8
lines changed

CHANGELOG.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@ Previously they were working with **and without** pseudo syntax ':'
44
Now you must use `@custom-selector :--{name}` syntax instead of `@custom-selector --{name}`
55
The support of syntax without : and the warning message will be remove in the next major release
66
([#97](https://github.com/cssnext/cssnext/issues/97))
7-
- Added: `plugins` option that allows you to pipe your own transformations ([#118](https://github.com/cssnext/cssnext/issues/118))
8-
- Added: `messages` option that allows you to see messages of transformations ([#88](https://github.com/cssnext/cssnext/issues/88))
7+
- Added: `plugins` option that allows you to pipe your own transformations
8+
([#118](https://github.com/cssnext/cssnext/issues/118))
9+
- Added: `messages` option that allows you to see messages of transformations
10+
([#88](https://github.com/cssnext/cssnext/issues/88))
11+
- Added: `:any-link` pseudo class support
912

1013
# 1.6.0 - 2015-06-02
1114

CONTRIBUTING.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,18 @@ $ git checkout -b fix.bug423
2020

2121
1. Add test files (input + expected output) in [`src/__tests__/fixtures/features`](src/__tests__/features)
2222
- If the feature can affect some others, update [`src/__tests__/fixtures/cases/example.css`](src/__tests__/cases/example.css) to test integration with other features
23-
- Run test, & check tests are broken (otherwise feature is useless)
23+
2424
- Choose a pretty simple and clear name (that match the specs)
2525
- Add the feature in the [README features list](#features) (title, link to spec, link of the plugin, short desc)
2626
- Add the feature in the [README node.js options list](#features-default-all-features) (camelCaseName)
2727
- Add the dependency in the [`package.json`](package.json)
2828
- Add the feature in the source (in [`index.js`](index.js)), in the appropriate place (order matter)
29+
For now, use a empty function instead of the right module
30+
- Run test, & check tests are broken (otherwise feature is useless)
31+
Now, call the right plugin
2932
- Run test and be happy
3033
- Add feature in [the docs](docs/content)
31-
- Add feature on [the playground](https://github.com/cssnext/playground) example
34+
- Add feature on [the playground](docs/content/playground.html) example
3235

3336

3437
### Edit messages styles

docs/content/features.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,21 @@ h1 {
251251
|
252252
[Plugin documentation](https://github.com/robwierzbowski/node-pixrem)
253253

254+
## `:any-link` pseudo-class
255+
256+
Allows you to use `:any-link` pseudo class.
257+
258+
```css
259+
nav :any-link {
260+
background-color: yellow;
261+
}
262+
```
263+
264+
[Specification](http://dev.w3.org/csswg/selectors/#any-link-pseudo)
265+
|
266+
[Plugin documentation](https://github.com/jonathantneal/postcss-pseudo-class-any-link)
267+
268+
254269
## `:matches` pseudo-class
255270

256271
Allows you to use `:matches()`.

docs/content/playground.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
}
4545
a:hover { color: gray(255, 50%) }
4646
a:active { color: rebeccapurple }
47-
a:visited { color: color(var(--highlightColor) blackness(+20%)) }
47+
a:any-link { color: color(var(--highlightColor) blackness(+20%)) }
4848

4949
/* font stuff */
5050
h2 {

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
"postcss-log-warnings": "^0.3.1",
5151
"postcss-media-minmax": "^1.1.0",
5252
"postcss-messages": "^0.2.2",
53+
"postcss-pseudo-class-any-link": "^0.2.1",
5354
"postcss-pseudoelements": "^2.1.1",
5455
"postcss-selector-matches": "^1.0.1",
5556
"postcss-selector-not": "^1.0.1",

src/__tests__/fixtures/cases/example.actual.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ a {
3636
}
3737
a:hover { color: #FFFFFF; color: rgba(255, 255, 255, 0.5) }
3838
a:active { color: rgb(102, 51, 153) }
39-
a:visited { color: rgb(89, 142, 153) }
39+
a:link,a:visited { color: rgb(89, 142, 153) }
4040

4141
/* font stuff */
4242
h2 {

src/__tests__/fixtures/cases/example.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ a {
3434
}
3535
a:hover { color: gray(255, 50%) }
3636
a:active { color: rebeccapurple }
37-
a:visited { color: color(var(--highlightColor) blackness(+20%)) }
37+
a:any-link { color: color(var(--highlightColor) blackness(+20%)) }
3838

3939
/* font stuff */
4040
h2 {

src/__tests__/fixtures/cases/example.expected.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ a {
3636
}
3737
a:hover { color: #FFFFFF; color: rgba(255, 255, 255, 0.5) }
3838
a:active { color: rgb(102, 51, 153) }
39-
a:visited { color: rgb(89, 142, 153) }
39+
a:link,a:visited { color: rgb(89, 142, 153) }
4040

4141
/* font stuff */
4242
h2 {
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
nav :any-link > span {
2+
background-color: yellow;
3+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
nav :link > span,nav :visited > span {
2+
background-color: yellow;
3+
}

0 commit comments

Comments
 (0)