Replies: 9 comments
-
I'm not sure if this is the "right" way to do it, but here's what I did.
I think that's all I had to do, but it took me so long of trial and error that I don't quite remember now. Hopefully it'll get you started at least. |
Beta Was this translation helpful? Give feedback.
-
thanks for this , very much. |
Beta Was this translation helpful? Give feedback.
-
no problem! don't be too hard on them. i'm sure this is just something in their free time, and you never know what's going on in someone's life. plus, this is the joy of open source! we all have the opportunity to contribute, even if it's just helping someone with a question. anyway, i'm glad i could help! |
Beta Was this translation helpful? Give feedback.
-
I don't quite get what you did here. If you want to override the tailwind default values, you can do that in tailwind.config.cjs (https://tailwindcss.com/docs/font-size#using-custom-values), right? Or am I missing something? Btw., for a simple way to change the font, check out https://fontsource.org.
|
Beta Was this translation helpful? Give feedback.
-
@Because789 I'm a data engineer, so all of this is pretty outside of my comfort zone, so take this with a grain of salt. I'm also not familiar with fontsource. Maybe it gets around some of these issues! I don't remember exactly why I went down this path, but it might've been issues caused by loading local fonts, as opposed to using a CDN. I wish I had written real commit messages while troubleshooting. That said, I'm not sure your approach would work. Preflight creates base styles that can only be overwritten by extending Preflight and adding new base styles. Adding the This is all a little hazy, I'm sure I'm not explaining this well because I don't fully understand it myself. But this StackOverflow answer helped a bit. |
Beta Was this translation helpful? Give feedback.
-
@jbrr Thanks a lot for your quick reply! Since I'm just a hobby programmer, you should very much take everything I say with a grain of salt, too :) That said, I still don't get, why you had to override any Tailwind base styles just to change the font. I get that you extended the base with the custom "sansTitle* in https://github.com/jbrr/jbrr.dev/blob/v3.1/tailwind.config.cjs. But I still think there shouldn't be the need to set the font-face in the base.css. Here is a working example for changing the font how I described it above: https://github.com/Because789/astro-blog (offline, working on an improved version). The only things I did were:
That was it, and like that all the original AstroPaper stylings (bold, italic, etc.) were preserved. The only problem is, with this method, the OGimage generator still uses the IBM font. I'm currently working on a solution for that. Anyway, I get that you did all that a while ago and on top of that you used a different method with downloaded fonts. At the end, all that matters is, that it worked for you! |
Beta Was this translation helpful? Give feedback.
-
I could've sworn I tried something like that, but who knows. If nothing else, it's good to have multiple solutions here that people can try if they run into a similar issue. It's be nice to get someone to chime in who's a real expert on this stuff. |
Beta Was this translation helpful? Give feedback.
-
@Because789's method worked perfectly for me. This person has some instructions too, albeit in Japanese. |
Beta Was this translation helpful? Give feedback.
-
I'll convert this issue to a discussion. |
Beta Was this translation helpful? Give feedback.
-
I'd like to change font to Overpass and call it from google or other cdn.
how would I do that?
Beta Was this translation helpful? Give feedback.
All reactions