postcss-calc icon indicating copy to clipboard operation
postcss-calc copied to clipboard

Browserlist support

Open leimonio opened this issue 6 years ago • 7 comments

This is more a kind of question:

  • Would it make sense if postcss-calc transformations were based on the browsers support configured through browserlist?
  • How would this affect postcss-calc?
  • If postcss-calc is not the correct repository to implement such logic, which one would be? Would it be cssnano-preset-default or a different one?

For example by using cssnano-preset-default we can define this configuration in postcss.config.js:

module.exports = {
   plugins: [
       require('cssnano')({
         preset: ['default', {
             calc: false,
         }]
       }),
   ],
};

leimonio avatar Jan 20 '19 11:01 leimonio

@leimonio what transformation of calc doesn't work in some browsers, but works in other?

alexander-akait avatar Jan 25 '19 14:01 alexander-akait

I mean mostly based on browser support. e.g. there are browsers supporting inner calc whereas others not, right? Or otherwise, based on full/partial/not all support enable different strategies of transformations or totally disable them. I'm not sure if this makes sense.

leimonio avatar Jan 25 '19 14:01 leimonio

@leimonio

I mean mostly based on browser support. e.g. there are browsers supporting inner calc whereas others not, right?

Yep you are right https://caniuse.com/#search=calc (Known issues), feel free to send a PR

alexander-akait avatar Jan 25 '19 14:01 alexander-akait

It should be easy and you can see how we do this in cssnano

alexander-akait avatar Jan 25 '19 14:01 alexander-akait

Sounds good, I'll a look at the repo. Is there something you'd like to share as guidance? Closing this issue, since it's irrelevant to the scope of this repo.

leimonio avatar Jan 25 '19 17:01 leimonio

@leimonio don't this it is out of scope, because i can't disable some changes in calc optimization in cssnano, let's open this

alexander-akait avatar Jan 25 '19 17:01 alexander-akait

Accidentally closed it twice. I’d like to contribute on that.

leimonio avatar Jan 25 '19 20:01 leimonio