Skip to content

Commit 7b8526d

Browse files
authored
Add default browsers list for autoprefixer (#38)
Add default browsers list for autoprefixer Fixes #34
1 parent 025f885 commit 7b8526d

File tree

11 files changed

+61
-18
lines changed

11 files changed

+61
-18
lines changed

CHANGELOG.md

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

3+
* Add default browsers list for autoprefixer
34
* Use `stylelint-config-suitcss` from within the preprocessor. No longer needs
45
to be installed locally by the consumer.
56

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,21 @@ var result = [
278278
];
279279
```
280280

281+
#### Autoprefixer: vendor prefixes
282+
283+
By default the preprocessor uses the SUIT
284+
[browserslist](https://github.com/ai/browserslist) configuration:
285+
286+
```
287+
> 1%, last 2 versions, safari > 6, ie > 9, ios > 6, android > 4.3, samsung > 3, chromeandroid > 50
288+
```
289+
290+
The preprocessor doesn't attempt to find any `browserslist` config file.
291+
292+
Instead you can customise the browsers list
293+
via [configuration file](#plugin-configuration).
294+
295+
281296
## Acknowledgements
282297

283298
Based on [Myth](https://github.com/segmentio/myth) by Segment.io.

lib/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ var defaults = {
3232
'autoprefixer',
3333
'postcss-reporter'
3434
],
35+
autoprefixer: {
36+
browsers: '> 1%, last 2 versions, safari > 6, ie > 9, ' +
37+
'ios > 6, android > 4.3, samsung > 3, chromeandroid > 50'
38+
},
3539
'postcss-easy-import': {
3640
onImport: function(imported) {
3741
// Update the watch task with the list of imported files

test/fixtures/cli/input.out.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
.cli {
22
color: #f00;
33
width: 100px;
4-
-webkit-transition: all 1s;
54
transition: all 1s;
65
}
76

test/fixtures/component.out.css

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
}
1111

1212
.Component-item {
13-
display: -webkit-box;
14-
display: -ms-flexbox;
1513
display: flex;
1614
}
1715

test/fixtures/config.out.css

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
}
1111

1212
.Component-item {
13-
display: -webkit-box;
14-
display: -ms-flexbox;
1513
display: flex;
1614
}
1715

test/fixtures/import.out.css

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
body {
2-
-webkit-transition: -webkit-transform 1s;
3-
transition: transform 1s;
2+
transition: transform 1s;
43
}

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:-webkit-box;display:-ms-flexbox;display:flex}@media (min-width:200px){.Component-item{color:red}}
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}}

test/noautoprefixer.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = {
2+
autoprefixer: {
3+
add: false,
4+
remove: false
5+
}
6+
};

test/test.config.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,9 @@ module.exports = {
55
},
66
use: [
77
"postcss-property-lookup"
8-
]
8+
],
9+
autoprefixer: {
10+
add: false,
11+
remove: false
12+
}
913
};

0 commit comments

Comments
 (0)