KevinInChicago Posted January 8 Share Posted January 8 Here is my use case. I have a section for the home page of my website. There is a featured font for the event we want to advertise in this banner. We are using Rye (https://fonts.google.com/specimen/Rye?query=Rye) across other advertising channels. We want to update the font for two text blocks in my describing section. Here is my code block for CSS. Please note that I will just copy and paste this code for the second block and update the blockID. #block-814739f676fa06738add { font-family: 'Rye'; font-size: '3em'; } I can see the change live if I update the font family to 'Arial'. When I set it to 'Rye' I get some sort of fallback font family (this is how I know the blockID is correct). This is a display font (that's how it's listed in the Styles > Fonts section of the style editor). Here is a screenshot of the end result. I don't see Rye, just the fallback (see attached). Thanks in advance for your help! Link to comment
Ziggy Posted January 8 Share Posted January 8 You have the word display after font-family in the CSS editor, can you update your Custom CSS with the code you shared: #block-814739f676fa06738add { font-family: 'Rye'; font-size: '3em'; } Please like and upvote if my comments were helpful to you. Cheers! Zygmunt Spray Squarespace Website Designer Contact me: https://squarefortytwo.com Hire me on Upwork! 🔌 Ghost Squarespace Plugins (Referral link) 📈 SEO Space (Referral link) ⬛ SquareWebsites Plugins (Referral link) 🔲 SQSP Themes (Referral link) ✨ Spark Plugin (Referral link) 🖼️ Pinch-to-Zoom Gallery Lightbox Plugin (Referral link) ☕ Did I help? Buy me a coffee? Link to comment
KevinInChicago Posted January 8 Author Share Posted January 8 Hi. Sorry about that. I had initially used the code you posted, but sadly, it's the fallback font. Link to comment
Solution KevinInChicago Posted January 8 Author Solution Share Posted January 8 I'm watching this video. This developer has the answer! It turns out that I needed to add some additional code to the CSS block. I needed to import the font from google. Link to comment
melody495 Posted January 8 Share Posted January 8 (edited) 1 hour ago, KevinInChicago said: This is a display font (that's how it's listed in the Styles > Fonts section of the style editor). Hi @KevinInChicago responding to your DM, I believe SquareSpace only loads the 2 font family that you have selected as your heading and paragraphs. (Can you imagine, that is a lot of font files!) So if you want to use a third font family, then you will have to treat it as a custom font. The video you have linked is one way of using Google Font. This import method relies on the font file being hosted and served by Google. The other method is to upload the font file to your SquareSpace Website. Via the usual method of @font-face etc. Here you can find my Beginner's Guide to Custom Font. The pros and cons can be down to speed, although I haven't compared them myself! I prefer having control over my custom code, so I would normally upload my own font file even when it's a Google Font. But that's just my preference 🙂 Hope this helps. Edited January 8 by melody495 -------- > 👆 <---------- Please quote or @ me when replying, or I won't get a notification Melody | Squarespace Nerd 💻 💁♀️ 1-2-1 Squarespace Training session <- feeling stuck and want to learn? 👩💻 💁♀️ Website help <- send me your to-do list. From code to plugin to domain setup. 🧰 See the tools I use (contain affiliate links) ☕ Did I help? I like coffee (Thank you) Link to comment
KevinInChicago Posted January 8 Author Share Posted January 8 @melody495 and @Ziggy I can update my text blocks but for some reason, that technique didn't work for my tertiary button style. Thoughts about what I need to do to make it apply to the button too? Link to comment
KevinInChicago Posted January 8 Author Share Posted January 8 New issue, for some reason, the Rye font appears in preview mode when the CSS editor is up but not on the live front end at embracewa.org @import url('https://fonts.googleapis.com/css?family=Rye&display=swap'); #block-7ff5670405e4c801c2fa, #block-6afaec43d023f245655c, #block-c47804bd540c1a7b22a4, #block-1b8e7264c616ddad531c { font-family: 'Rye'; } Link to comment
tuanphan Posted January 10 Share Posted January 10 On 1/9/2024 at 5:49 AM, KevinInChicago said: New issue, for some reason, the Rye font appears in preview mode when the CSS editor is up but not on the live front end at embracewa.org @import url('https://fonts.googleapis.com/css?family=Rye&display=swap'); #block-7ff5670405e4c801c2fa, #block-6afaec43d023f245655c, #block-c47804bd540c1a7b22a4, #block-1b8e7264c616ddad531c { font-family: 'Rye'; } Try adding this code to Website Tools > Code Injection > Header <link rel="preconnect" href="https://fonts.googleapis.com"> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;700&family=Rye&display=swap" rel="stylesheet"> Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!) Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment