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

Commit 6922502

Browse files
committed
Added: pseudoelements PostCSS Plugin
Close #81
1 parent 9ff81ec commit 6922502

File tree

7 files changed

+30
-3
lines changed

7 files changed

+30
-3
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 1.2.0 - 2015-04-02
2+
3+
- Added: pseudoElements single colon fallback for pseudoElements double colons
4+
15
# 1.1.0 - 2015-03-05
26

37
- Added: `--config` CLI option

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ The official name is **cssnext**, which should never be capitalized, especially
1818
[Why](#why) | [Features](#features) | [Limitations](#limitations) | [Installation](#installation)| [CLI Usage](#cli) | [Node.js API](#nodejs-api) | [Contribute](#contributing)
1919
--- | --- | --- | --- | --- | --- | ---
2020

21-
---
21+
---
2222

2323
## Why
2424

@@ -61,7 +61,8 @@ Follow [@cssnext on Twitter](https://twitter.com/cssnext) to get the latest news
6161
([](https://github.com/iamvdo/pleeease-filters))
6262
* [rem](http://www.w3.org/TR/css3-values/#rem-unit) units
6363
([](https://github.com/robwierzbowski/node-pixrem))
64-
64+
* [pseudo-elements](http://www.w3.org/TR/css3-selectors/#pseudo-elements)
65+
([](https://github.com/axa-ch/postcss-pseudoelements))
6566
### Bonus features
6667

6768
_<small>The features below are considered as bonus since it's totally not related to CSS specs</small>._
@@ -250,6 +251,7 @@ Here are all the available features:
250251
- `fontVariant`
251252
- `filter`
252253
- `rem`
254+
- `pseudoElements`
253255
- `autoprefixer`
254256

255257
_Note: order is important to get everything working correctly._

index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ var caniuseFeaturesMap = {
2323
// colorFunction:[null],
2424
// fontVariant: [null],
2525
// filter: [null], // @todo can be done using a callback, this is only used for Firefox < 35
26+
pseudoElements: ["css-gencontent"],
2627
rem: ["rem"],
2728
// autoprefixer: [null] // will always be null since autoprefixer does the same game as we do
2829
}
@@ -42,6 +43,7 @@ var features = {
4243
fontVariant: function(options) { return require("postcss-font-variant")(options)},
4344
filter: function(options) { return require("pleeease-filters")(options)},
4445
rem: function(options) { return require("pixrem")(options)},
46+
pseudoElements: function(options) { return require("postcss-pseudoelements")(options)},
4547
autoprefixer: function(options) { return require("autoprefixer-core")(options).postcss}
4648
}
4749

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cssnext",
3-
"version": "1.1.0",
3+
"version": "1.2.0",
44
"description": "Use tomorrow's CSS syntax, today",
55
"keywords": [
66
"css",
@@ -50,6 +50,7 @@
5050
"postcss-font-variant": "^1.0.0",
5151
"postcss-import": "^5.0.0",
5252
"postcss-media-minmax": "^1.1.0",
53+
"postcss-pseudoelements": "^2.1.1",
5354
"postcss-url": "^2.0.0",
5455
"read-file-stdin": "^0.2.0",
5556
"to-slug-case": "^0.1.2",

test/fixtures/cases/example.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,9 @@ table {
5252
.sepia {
5353
filter: sepia(.8);
5454
}
55+
56+
/* pseudo-elements */
57+
a::before,
58+
a::after {
59+
content:"pseudo-elements"
60+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.foo::after {
2+
content:"pseudoelement"
3+
}
4+
.foo::before {
5+
content:"pseudoelement"
6+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.foo:after {
2+
content:"pseudoelement"
3+
}
4+
.foo:before {
5+
content:"pseudoelement"
6+
}

0 commit comments

Comments
 (0)