Taro 4 + weapp-tailwindcss 4 下,微信小程序加载自定义字体 #637
Fiber-Man
started this conversation in
Show and tell
Replies: 1 comment
-
非常棒,感谢,我维护到官方文档里,并把 link 链接过来 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
迟到的作业!
感谢 @sonofmagic 的辛苦付出,让我们能在小程序上幸福的使用 tailwindcss 进行开发!
起因是在小程序中希望加载自定义字体,前前后后折腾了半天(半天>=1天多)也没搞定,于是向 @sonofmagic 请教,目的是希望了解一下 weapp-tailwindcss 是否支持自定义字体,然后再倒腾。事后知道他当时在开会,开完会回复我的时候,我恰巧解决了,在 @sonofmagic 的建议下,来发此文,如果大家有同样的需求,希望能帮大家节约时间,避免“无效”工作。
参考:https://tailwindcss.com/docs/font-family
在 app.css 中加入代码( url 替换自己服务器地址)
按说这样就好了
但是,就是不行。
折腾...
参考:https://developers.weixin.qq.com/miniprogram/dev/api/ui/font/wx.loadFontFace.html
就这么简单!
再次感谢 @sonofmagic 让大家开发小程序能用上 tailwindcss !!!
Beta Was this translation helpful? Give feedback.
All reactions