Skip to content

Commit 42bf070

Browse files
simonsmithgiuseppeg
authored andcommitted
Add postcss-color-function and postcss-apply (#47)
Fixes #45 Fixes #44
1 parent d9717b0 commit 42bf070

File tree

9 files changed

+28
-1
lines changed

9 files changed

+28
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
### HEAD
22

3+
* Add `postcss-apply`
4+
* Add `postcss-color-function`
35
* Add `debug` option to pass an `postcss-debug` instance
46
* Allow usage of `transform` and `onImport` in `postcss-easy-import`
57
* Remove `beforeLint` feature

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ Compiles CSS packages with:
1212
* [postcss-easy-import](https://github.com/TrySound/postcss-easy-import)
1313
* [postcss-custom-properties](https://github.com/postcss/postcss-custom-properties)
1414
* [postcss-calc](https://github.com/postcss/postcss-calc)
15+
* [postcss-color-function](https://github.com/postcss/postcss-color-function)
16+
* [postcss-apply](https://github.com/pascalduez/postcss-apply)
1517
* [postcss-custom-media](https://github.com/postcss/postcss-custom-media)
1618
* [autoprefixer](https://github.com/postcss/autoprefixer)
1719

@@ -262,7 +264,9 @@ var defaults = [
262264
'postcss-easy-import',
263265
'postcss-custom-properties',
264266
'postcss-calc',
267+
'postcss-color-function',
265268
'postcss-custom-media',
269+
'postcss-apply',
266270
'autoprefixer',
267271
'postcss-reporter'
268272
];
@@ -280,7 +284,9 @@ module.exports = {
280284
var result = [
281285
'postcss-easy-import',
282286
'postcss-custom-properties',
287+
'postcss-color-function',
283288
'postcss-custom-media',
289+
'postcss-apply',
284290
'postcss-at2x',
285291
'postcss-calc',
286292
'autoprefixer',

lib/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ var defaults = {
2323
'postcss-easy-import',
2424
'postcss-custom-properties',
2525
'postcss-calc',
26+
'postcss-color-function',
2627
'postcss-custom-media',
28+
'postcss-apply',
2729
'autoprefixer',
2830
'postcss-reporter'
2931
],

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,10 @@
2222
"object-assign-deep": "0.0.4",
2323
"pad-component": "0.0.1",
2424
"postcss": "^5.0.12",
25+
"postcss-apply": "^0.4.0",
2526
"postcss-bem-linter": "^2.3.0",
2627
"postcss-calc": "^5.0.0",
28+
"postcss-color-function": "^2.0.1",
2729
"postcss-custom-media": "^5.0.0",
2830
"postcss-custom-properties": "^5.0.0",
2931
"postcss-easy-import": "^1.0.1",

test/fixtures/component.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,20 @@
66

77
:root {
88
--Component-size: 16px;
9+
--Component-color: {
10+
color: green;
11+
};
912
}
1013

1114
.Component {
1215
font-size: var(--Component-size);
1316
width: calc(100% * 1 / 6);
17+
background: color(red a(90%));
1418
}
1519

1620
.Component-item {
1721
display: flex;
22+
@apply --Component-color;
1823
}
1924

2025
@media (--media-query) {

test/fixtures/component.out.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@
77
.Component {
88
font-size: 16px;
99
width: 16.66667%;
10+
background: rgba(255, 0, 0, 0.9);
1011
}
1112

1213
.Component-item {
1314
display: flex;
15+
color: green;
1416
}
1517

1618
@media (min-width: 200px) {

test/fixtures/config.out.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@
77
.Component {
88
font-size: 16px;
99
width: 16.66667%;
10+
background: rgba(255, 0, 0, 0.9);
1011
}
1112

1213
.Component-item {
1314
display: flex;
15+
color: green;
1416
}
1517

1618
@media (min-width: 200px) {

test/fixtures/minify.out.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
.u-img{border-radius:50%}.Component{font-size:16px;width:16.66667%}.Component-item{display:flex}@media (min-width:200px){.Component-item{color:red}}
1+
.u-img{border-radius:50%}.Component{font-size:16px;width:16.66667%;background:rgba(255,0,0,.9)}.Component-item{display:flex;color:green}@media (min-width:200px){.Component-item{color:red}}

test/test.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,9 @@ describe('suitcss', function() {
8787
'postcss-easy-import',
8888
'postcss-custom-properties',
8989
'postcss-calc',
90+
'postcss-color-function',
9091
'postcss-custom-media',
92+
'postcss-apply',
9193
'autoprefixer',
9294
'postcss-reporter'
9395
]);
@@ -223,7 +225,9 @@ describe('suitcss', function() {
223225
expect(opts.use).to.eql([
224226
'postcss-easy-import',
225227
'postcss-custom-properties',
228+
'postcss-color-function',
226229
'postcss-custom-media',
230+
'postcss-apply',
227231
'autoprefixer',
228232
'postcss-at2x',
229233
'postcss-calc',
@@ -240,7 +244,9 @@ describe('suitcss', function() {
240244
'postcss-easy-import',
241245
'postcss-custom-properties',
242246
'postcss-calc',
247+
'postcss-color-function',
243248
'postcss-custom-media',
249+
'postcss-apply',
244250
'autoprefixer',
245251
'postcss-reporter',
246252
'postcss-at2x',

0 commit comments

Comments
 (0)