Lehoczky / postcss-fluid

PostCSS plugin that makes it easier to work with fluid css values
https://lehoczky.github.io/postcss-fluid/
13 stars 1 forks source link

Add fallback support #7

Closed JacobDB closed 1 month ago

JacobDB commented 3 months ago

An option to include a fallback for browsers that don't support clamp would be nice. Settings could include outputting the min value or max value only, an average of the two, or output media queries for both (i.e. jump instead of scale).

Lehoczky commented 3 months ago

Hi there 👋

You can use postcss-preset-env in combination with this plugin to convert modern CSS syntax for older browsers.

If you get it working, we can add this to the README.

Lehoczky commented 1 month ago

Upon some investigation, it look like the postcss-clamp plugin has trouble converting complex clamp declarations like what this library produces.

Manually implementing something like you suggested, could work, but that would increase the bundle size of this library, so for now I consider only supporting "modern" (clamp is really widely supported) browsers.