You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
π Hi! I am using variable font in my project and wanna to use fontFace mixin to generate @font-face declarations. I am new to β¨ polished, but it seems not possible to do for now π€
Variable fonts require more exotic type of src rule with specific format hints. In my case src rule should look like this:
But formatHint adds format('woff2') hint and with that variable font is "buggy": correlation between font weights is broken and animations don't work smoothly. So you need proper hint anyways.
Simple solution for that is to add string[] variation of formatHint property. But this doesn't work with my second example of more complicated type of src. So maybe better way is to make possible to write fully custom src string instead of fontFilePath or change its format...
For now i just don't use fontFace mixin and go with pure CSS in JS solution:
π Hi! I am using variable font in my project and wanna to use
fontFace
mixin to generate@font-face
declarations. I am new to⨠polished
, but it seems not possible to do for now π€Variable fonts require more exotic type of
src
rule with specific format hints. In my casesrc
rule should look like this:But also i have seen suggestions to include variable font like this (in great article by Jason Pamental):
So with current API the closest way to do it will be:
But
formatHint
addsformat('woff2')
hint and with that variable font is "buggy": correlation between font weights is broken and animations don't work smoothly. So you need proper hint anyways.Simple solution for that is to add string[] variation of
formatHint
property. But this doesn't work with my second example of more complicated type ofsrc
. So maybe better way is to make possible to write fully customsrc
string instead offontFilePath
or change its format...For now i just don't use
fontFace
mixin and go with pure CSS in JS solution:The text was updated successfully, but these errors were encountered: