Skip to content

Commit fba0117

Browse files
committed
docs($docs): Added the documentation about Autoprefixer
1 parent ce47a1f commit fba0117

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

template/README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ You can find the most recent version of this guide [here](https://github.com/hal
2222
- [Turning off Elm Debugger](#turning-off-elm-debugger)
2323
- [Changing the Page `<title>`](#changing-the-page-title)
2424
- [Adding a Stylesheet](#adding-a-stylesheet)
25+
- [Post-Processing CSS](#post-processing-css)
26+
- [Using elm-css](#using-elm-css)
2527
- [Adding Images and Fonts](#adding-images-and-fonts)
2628
- [Using the `public` Folder](#using-the-public-folder)
2729
- [Changing the HTML](#changing-the-html)
@@ -195,6 +197,30 @@ body {
195197
import './main.css'; // Tell Webpack to pick-up the styles from base.css
196198
```
197199

200+
## Post-Processing CSS
201+
202+
This project setup minifies your CSS and adds vendor prefixes to it automatically through [Autoprefixer](https://github.com/postcss/autoprefixer) so you don’t need to worry about it.
203+
204+
For example, this:
205+
206+
```css
207+
.container {
208+
display: flex;
209+
flex-direction: row;
210+
align-items: center;
211+
}
212+
```
213+
214+
becomes this:
215+
216+
```css
217+
.container {
218+
display: -webkit-box;
219+
display: -ms-flexbox;
220+
display: flex;
221+
}
222+
```
223+
198224
In development, expressing dependencies this way allows your styles to be reloaded on the fly as you edit them. In production, all CSS files will be concatenated into a single minified `.css` file in the build output.
199225

200226
You can put all your CSS right into `src/main.css`. It would still be imported from `src/index.js`, but you could always remove that import if you later migrate to a different build tool.

0 commit comments

Comments
 (0)