Recently, I have been studying the theme of
vitepress
and I am planning to switch my blog fromhugo
tovitepress
(because the code blocks invitepress
look better than those inhugo
).
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
.