madeleineostoja / postcss-responsive-type

Automagical responsive typography, built on PostCSS
372 stars 21 forks source link

Compatibility with third party plugins #44

Open ChangeSomeCode opened 2 years ago

ChangeSomeCode commented 2 years ago

Hi!

I got a problem when is specified a implicit value. For example, through the use of variables or mixins:

:root {
  --min-max: 320px 1440px;
}

@define-mixin font $minFontSize, $maxFontSize {
  font-size: responsive $minFontSize $maxFontSize;
  font-range: var(--min-max); 
}

h1 {
  @mixin font 36px, 36px;
}

the plugin takes a value in font-range that has not yet been processed - the string var(--min-max) and tries to calculate it. Now the value var(--min-max) is first converted by thrid party plugin to the 320px 1440px and only then the postcss-responsive-type plugin will be applied

new call method is performed by condition in options

ChangeSomeCode commented 2 years ago

fix for #33