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

fit-content problem #21

Closed WildEgo closed 3 years ago

WildEgo commented 3 years ago

Hey I just wanted to try this package and found out and found this little problem, for context my PostCSS version on package.json is ^8.2.2.

The error:

JisonLexerError in plugin "gulp-postcss"
Message:
    Lexical error on line 1: Unrecognized text.

  Erroneous area:
1: -1 * fit-content * var(--fgp-gap_percentage-decimal_column)
^.......^
Details:
    hash: [object Object]
    postcssNode: --fgp-gap_percentage-to-pixels_column:calc(-1 * fit-content * var(--fgp-gap_percentage-decimal_column)) !important
    fileName: E:\www\public\css\main-responsive.css
    domainEmitter: [object Object]
    domainThrown: false

The setup for postcss below (flexgap standing for flex-gap-polyfill):

postcss([flexgap(), autoprefixer(), calc(), cssnano()])

Regards, Luis Bizarro.

gavinmcfarland commented 3 years ago

Hi Luis, thanks for reporting that. I think I know what's causing that. I've pushed a fix for it with a major release which uses PostCSS 8.

I really need to refactor the plugin for a better way of checking for compatible values for width, but let me know if version 2.0.0 solves this issue.

Many thanks, Gavin

WildEgo commented 3 years ago

Hi Luis, thanks for reporting that. I think I know what's causing that. I've pushed a fix for it with a major release which uses PostCSS 8.

I really need to refactor the plugin for a better way of checking for compatible values for width, but let me know if version 2.0.0 solves this issue.

Many thanks, Gavin

I'll check it as soon as I can, thanks a lot I'll update u with what I find!

WildEgo commented 3 years ago

Heads up it has problems with "width: max-content" but no problem I didn't need that one anyway personally.

gavinmcfarland commented 3 years ago

Doh, sorry about that. When I get chance over the weekend. I'll fix it properly. It's not even really needed unless you're using percentages, so I might add an option to disable if not using percentage gaps.

gavinmcfarland commented 3 years ago

@WildEgo thanks for your help raising this issue. I've updated it with a much better check for units now, so max-content should work also. Thanks agin.