usabilla / button-generator

Node module that generates a button image.
1 stars 0 forks source link

fix(font-types): check font type based on fontName #24

Closed beerecca closed 7 years ago

beerecca commented 7 years ago

Reviewers: @beerecca @dine @keepitterron @pietvanzoen @tjinauyeung

Fixes bug where custom fonts weren't being applied to buttons. In the themes-api, if a button font prop doesn't exist (eg fontCssUrl), it falls back to the theme value for that prop. Then if you created a button with a fontFileUrl that had a matching fontName, this code in the button generator would see the fontCssUrl first and apply that, with the fontName which doesn't match, and therefore no font would be applied.