gavinmcfarland / flex-gap-polyfill

A PostCSS plugin to emulate flex gap using margins
https://gavinmcfarland.github.io/flex-gap-polyfill/
Creative Commons Zero v1.0 Universal
143 stars 6 forks source link

How to optimise #14

Closed gavinmcfarland closed 3 years ago

gavinmcfarland commented 6 years ago

For example all width's are currently re-written for reliability but this comes at a cost of larger CSS file.

gavinmcfarland commented 4 years ago
gavinmcfarland commented 4 years ago

To avoid rewriting all width and flex-basis properties, we can make a variable available which will then employ the polyfill for that property.

For example:

.flex_item {
    flex-basis: calc(50% - var(--flex-gap));
}

The polyfill will do the rest.