MrMinks Posted November 8, 2021 Share Posted November 8, 2021 Site URL: https://copper-violin-y56t.squarespace.com Hi all, So I've been constructing my new portfolio over the past couple days. I've been using Squarespace's custom CSS feature to style parts of my site, including the addition of a font called Inter (https://fonts.google.com/specimen/Inter). However, after coding it all in using Microsoft Edge, I tested out the site using Chrome. Something weird happened; the Inter specific text appeared a lot thicker than what it should. I then tested the site using Firefox, the Inter specific text then appeared really thin in comparison. The portfolio using Microsoft Edge displays the site as it should look like, but the CSS font just seems to be having issues across alternative browsers (see attached screenshots - also see their naming conventions). I also tested the site using Safari for iOS, and the Inter font just didn't seem to persist at all, changing to a close sans-serif alternative. Can anyone help me resolve this bug, please? The way I have imported the inter font from Google is as follows: @import url('https://fonts.googleapis.com/css?family=Inter:wght@100;200;300;400;500;600;700;800;900&display=swap'); @font-face{font-family: 'Inter', sans-serif} I have also tried importing using the alternative method, as follows (to no vail): @font-face { font-family: 'Inter'; src: url('https://fonts.googleapis.com/css?family=Inter:wght@100;200;300;400;500;600;700;800;900&display=swap');} I'm stumped, honestly. Any help would be greatly appreciated! Kind Regards, Elliot Link to comment
Beyondspace Posted November 8, 2021 Share Posted November 8, 2021 10 hours ago, MrMinks said: Site URL: https://copper-violin-y56t.squarespace.com Hi all, So I've been constructing my new portfolio over the past couple days. I've been using Squarespace's custom CSS feature to style parts of my site, including the addition of a font called Inter (https://fonts.google.com/specimen/Inter). However, after coding it all in using Microsoft Edge, I tested out the site using Chrome. Something weird happened; the Inter specific text appeared a lot thicker than what it should. I then tested the site using Firefox, the Inter specific text then appeared really thin in comparison. The portfolio using Microsoft Edge displays the site as it should look like, but the CSS font just seems to be having issues across alternative browsers (see attached screenshots - also see their naming conventions). I also tested the site using Safari for iOS, and the Inter font just didn't seem to persist at all, changing to a close sans-serif alternative. Can anyone help me resolve this bug, please? The way I have imported the inter font from Google is as follows: @import url('https://fonts.googleapis.com/css?family=Inter:wght@100;200;300;400;500;600;700;800;900&display=swap'); @font-face{font-family: 'Inter', sans-serif} I have also tried importing using the alternative method, as follows (to no vail): @font-face { font-family: 'Inter'; src: url('https://fonts.googleapis.com/css?family=Inter:wght@100;200;300;400;500;600;700;800;900&display=swap');} I'm stumped, honestly. Any help would be greatly appreciated! Kind Regards, Elliot What is your site's password? BeyondSpace - Squarespace Website Developer 🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox) 🗓️ Delivery Date Picker (Squarespace Date format) 💫 Animated Buttons (Referral URL) 🥳 Sparkplugin Customisations Browsers (Browse +100 Spark plugin customisations) 🥳 Elfsight Template Browsers (Browse +1000 Elfsight widget Templates) If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you! Link to comment
MrMinks Posted November 8, 2021 Author Share Posted November 8, 2021 8 hours ago, bangank36 said: What is your site's password? Hi Bangank, the sites password is: Squarespace01 Link to comment
Solution tuanphan Posted November 10, 2021 Solution Share Posted November 10, 2021 @MrMinks Try adding this to Settings > Advanced > 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@100;200;300;400;500;600;700;800;900&family=Montserrat:ital,wght@0,500;0,600;1,500;1,600&display=swap" rel="stylesheet"> If you use Personal Plan, you can edit Site Footer > Add a Code Block >> paste this code <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@100;200;300;400;500;600;700;800;900&family=Montserrat:ital,wght@0,500;0,600;1,500;1,600&display=swap" rel="stylesheet"> MrMinks 1 Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message How to: Setup Password & Share url - Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care Link to comment
MrMinks Posted November 11, 2021 Author Share Posted November 11, 2021 13 hours ago, tuanphan said: @MrMinks Try adding this to Settings > Advanced > 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@100;200;300;400;500;600;700;800;900&family=Montserrat:ital,wght@0,500;0,600;1,500;1,600&display=swap" rel="stylesheet"> If you use Personal Plan, you can edit Site Footer > Add a Code Block >> paste this code <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@100;200;300;400;500;600;700;800;900&family=Montserrat:ital,wght@0,500;0,600;1,500;1,600&display=swap" rel="stylesheet"> Hi Tuanphan, This seems to have worked! Thanks a bunch for this solution! Just for future reference and acknowledgement, would you mind explaining briefly why this code fixed the issue? Many thanks, Elliot Link to comment
tuanphan Posted November 14, 2021 Share Posted November 14, 2021 @MrMinks When you choose font from Google Font, you missing style tag And if you use @import approach you also need to add code to Code Injection, not Cusotm CSS Here I used <link> code I usually use this way Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message How to: Setup Password & Share url - Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care 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