Use display: flow-root
without a mess today, just add clearfix fallback by that simple plugin. Article about flow-root
.
Transform that:
.selector {
display: flow-root;
}
to
.selector {
display: flow-root;
}
.selector::after {
content: '';
display: table;
clear: both;
}
yarn add --dev postcss-flow-root
or
npm install --save-dev postcss-flow-root
And add to your postcss plugins list, for example in webpack
:
postcss: function () {
return [
require('postcss-flow-root')()
];
}