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

Commit 591ee58

Browse files
committed
Merge pull request #95 from cssnext/rgba-fallback
Added: color-rgba-fallback PostCSS Plugin
2 parents 62aeafb + 709827a commit 591ee58

File tree

8 files changed

+34
-2
lines changed

8 files changed

+34
-2
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 1.3.0 - 2015-04-15
2+
3+
- Added: hexadecimal fallback for rgba() color
4+
15
# 1.2.3 - 2015-04-10
26

37
- Fixed: --watch doesn't output console.log() related to watcherd/unwatched files anymore

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ Follow [@cssnext on Twitter](https://twitter.com/cssnext) to get the latest news
6363
([](https://github.com/robwierzbowski/node-pixrem))
6464
* [pseudo-elements](http://www.w3.org/TR/css3-selectors/#pseudo-elements)
6565
([](https://github.com/axa-ch/postcss-pseudoelements))
66+
* [rgba()](http://www.w3.org/TR/css3-color/)
67+
([](https://github.com/postcss/postcss-color-rgba-fallback))
6668
### Bonus features
6769

6870
_<small>The features below are considered as bonus since it's totally not related to CSS specs</small>._
@@ -252,6 +254,7 @@ Here are all the available features:
252254
- `filter`
253255
- `rem`
254256
- `pseudoElements`
257+
- `colorRgba`
255258
- `autoprefixer`
256259

257260
_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
@@ -24,6 +24,7 @@ var caniuseFeaturesMap = {
2424
// fontVariant: [null],
2525
// filter: [null], // @todo can be done using a callback, this is only used for Firefox < 35
2626
pseudoElements: ["css-gencontent"],
27+
colorRgba: ["css3-colors"],
2728
rem: ["rem"],
2829
// autoprefixer: [null] // will always be null since autoprefixer does the same game as we do
2930
}
@@ -44,6 +45,7 @@ var features = {
4445
filter: function(options) { return require("pleeease-filters")(options)},
4546
rem: function(options) { return require("pixrem")(options)},
4647
pseudoElements: function(options) { return require("postcss-pseudoelements")(options)},
48+
colorRgba: function(options) { return require("postcss-color-rgba-fallback")(options)},
4749
autoprefixer: function(options) { return require("autoprefixer-core")(options).postcss}
4850
}
4951

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.2.3",
3+
"version": "1.3.0",
44
"description": "Use tomorrow's CSS syntax, today",
55
"keywords": [
66
"css",
@@ -44,6 +44,7 @@
4444
"postcss-color-hex-alpha": "^1.1.0",
4545
"postcss-color-hwb": "^1.1.0",
4646
"postcss-color-rebeccapurple": "^1.1.0",
47+
"postcss-color-rgba-fallback": "^1.0.0",
4748
"postcss-custom-media": "^1.3.0",
4849
"postcss-custom-properties": "^3.0.0",
4950
"postcss-custom-selectors": "^1.1.0",

test/fixtures/cases/example.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,8 @@ a::before,
5858
a::after {
5959
content: "pseudo-elements"
6060
}
61+
62+
/* rgba() fallback */
63+
.color {
64+
background: rgba(153, 221, 153, 0.8);
65+
}

test/fixtures/cases/example.expected.css

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
/* some var() & calc() */
66
body {
7+
color: #123456;
78
color: rgba(18, 52, 86, 0.47059);
89

910
font-size: 16px;
@@ -33,7 +34,7 @@ a {
3334
-webkit-transition: color 1s;
3435
transition: color 1s; /* autoprefixed ! */
3536
}
36-
a:hover { color: rgba(255, 255, 255, 0.5) }
37+
a:hover { color: #FFFFFF; color: rgba(255, 255, 255, 0.5) }
3738
a:active { color: rgb(102, 51, 153) }
3839
a:visited { color: rgb(89, 142, 153) }
3940

@@ -69,3 +70,9 @@ a:before,
6970
a:after {
7071
content: "pseudo-elements"
7172
}
73+
74+
/* rgba() fallback */
75+
.color {
76+
background: #99DD99;
77+
background: rgba(153, 221, 153, 0.8);
78+
}

test/fixtures/features/color-rgba.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.foo {
2+
background: rgba(153, 221, 153, 0.8);
3+
border: solid 1px rgba(100,102,103,.3);
4+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.foo {
2+
background: #99DD99;
3+
background: rgba(153, 221, 153, 0.8);
4+
border: solid 1px #646667;
5+
border: solid 1px rgba(100,102,103,.3);
6+
}

0 commit comments

Comments
 (0)