You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/documentation/stories/autoprefixer.md
+14-2Lines changed: 14 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -7,21 +7,33 @@ or exclude certain browser versions from your build.
7
7
Internally, Autoprefixer relies on a library called [Browserslist](https://github.com/ai/browserslist)
8
8
to figure out which browsers to support with prefixing.
9
9
10
-
To set a custom browserlist config, add the following to your `package.json` file:
10
+
There are a few ways to tell Autoprefixer what browsers to target:
11
11
12
+
### Add a browserslist property to the `package.json` file
12
13
```
13
14
"browserslist": [
14
15
"> 1%",
15
16
"last 2 versions"
16
17
]
17
18
```
18
-
Autoprefixer will look for the `browserlist` property and array of targets to use when it prefixes your css.
19
+
20
+
### Add a new file to the project directory called `.browserslistrc`
21
+
```
22
+
### Supported Browsers
23
+
24
+
> 1%
25
+
last 2 versions
26
+
```
27
+
28
+
Autoprefixer will look for the configuration file/property to use when it prefixes your css.
19
29
Check out the [browserslist repo](https://github.com/ai/browserslist) for more examples of how to target
20
30
specific browsers and versions.
21
31
22
32
_Side note:_
23
33
Those who are seeking to produce a [progressive web app](https://developers.google.com/web/progressive-web-apps/) and are using [Lighthouse](https://developers.google.com/web/tools/lighthouse/) to grade the project will
24
34
need to add the following browserslist config to their package.json file to eliminate the [old flexbox](https://developers.google.com/web/tools/lighthouse/audits/old-flexbox) prefixes:
0 commit comments