Fix Global CSS with PostCSS

Andrey Sitnik, Evil Martians

Fix Global CSS with PostCSS

Andrey Sitnik, Evil Martians

Part 1 What is PostCSS?

Inside PostCSS

CSS
source map
Parser
Plugin
Plugin
Stringifier
New CSS
new source map

Plugin Example postcss-nested

.block {
    &_title {
        font-size: 200%;
    }
}
.block_title {
    font-size: 200%;
}

Plugin Example autoprefixer

:fullscreen {
}
:-webkit-full-screen {
}
:-moz-full-screen {
}
:-ms-fullscreen {
}
:fullscreen {
}

1 300 000 Downloads per Month

PostCSS Users

Part 2 Problem

Thinking Sass

.foo {
    @mixin transition(width 1s);
    @mixin rtl-float(left);
}

Use PostCSS to keep code maintainable—not just for syntax sugar

Why did we create computers?