fzdwx

fzdwx

Hello , https://github.com/fzdwx

Browser font weight not working

Recently, I have been studying the theme of vitepress and I am planning to switch my blog from hugo to vitepress (because the code blocks in vitepress look better than those in hugo).

When writing the theme, I found that the custom font setting font-weight I added does not take effect, but it works in hugo.

Finally, I tried one style after another using F12, and found that vitepress's body has the following styles:

text-rendering: optimizeLegibility;
direction: ltr;
font-synthesis: style;
-webkit-font-smoothing: antialiased;

The problem lies in font-synthesis: style;, which should be changed to weight.

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.