kristofferdarj Posted January 16, 2020 Share Posted January 16, 2020 I have two different sites to handle two languages. ( currics.com and currics.se ) Is it possible for them to share common css somehow? I have tried having a common less file on another server and importing it via less, but it doesn't seem to work This at the top of my custom css: @import url(https://static.currics.com/css/generic.less); just gives me an error: Cannot read property 'href' of undefined. Not sure about if I will end up in Cross-origin problems later but the error comes before that, in the editor. Shouldn't this be possible? Link to comment
dearnaomichan Posted November 8, 2020 Share Posted November 8, 2020 (edited) I am having the same error when I try to import a Google font in my css. Did you ever find a solution or figure out why this was happening? Edited November 8, 2020 by dearnaomichan Link to comment
tuanphan Posted November 10, 2020 Share Posted November 10, 2020 On 11/9/2020 at 5:42 AM, dearnaomichan said: I am having the same error when I try to import a Google font in my css. Did you ever find a solution or figure out why this was happening? You can use link rel & add to Code Injection Header 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
kristofferdarj Posted November 19, 2020 Author Share Posted November 19, 2020 (edited) Took a while until I got around to this. I tried injecting the following: <link rel="stylesheet/less" type="text/css" href="https://static.currics.com/css/generic.less" crossorigin="anonymous" /> <script src="//cdn.jsdelivr.net/npm/less" ></script> I had already configured CORS on the server as well. This sort of works. Everything looks fine when visiting the page ... BUT ... that less file isn't parsed when I'm editing my site. So depending on how custom stuff you have it might not be a good idea. For me it didn't work out. I still think it should be possible to do via an import statement. Wierd that squarespace doesn't allow it. Edited November 19, 2020 by kristofferdarj Edit: A clarification that it doesn't work in backend. Link to comment
Vit Posted December 4, 2021 Share Posted December 4, 2021 @tuanphan Hey, I have a similar QS on the topic, but with nuance that I'd like to host that CSS on a different hosting because the original place where this CSS hosted is unbelievably slow, so it takes lots of time before the webpage finally loads. Can I host a CSS on SS somehow? What could be the workaround here? Link to comment
tuanphan Posted December 8, 2021 Share Posted December 8, 2021 On 12/4/2021 at 8:40 PM, Vit said: @tuanphan Hey, I have a similar QS on the topic, but with nuance that I'd like to host that CSS on a different hosting because the original place where this CSS hosted is unbelievably slow, so it takes lots of time before the webpage finally loads. Can I host a CSS on SS somehow? What could be the workaround here? Upload CSS to your site, follow this guide https://support.squarespace.com/hc/en-us/articles/205813928-Uploading-and-managing-files Suppose, The uploaded file is style01.css To delcare CSS to your site, add this code into Code Injection > Header <link rel="stylesheet" href="/s/style01.css"> 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
Vit Posted December 8, 2021 Share Posted December 8, 2021 1 hour ago, tuanphan said: Upload CSS to your site, follow this guide https://support.squarespace.com/hc/en-us/articles/205813928-Uploading-and-managing-files Works great! Thanks so much! Beyondspace 1 Link to comment
Guest Posted January 2, 2022 Share Posted January 2, 2022 Is there a way to directly link a .css file on an external URL ? Either via code injection or something The css editor window in Squarespace is so small, I'd rather work in Visual Studio Code and sync to my ftp to make css changes. Uploading to directly Squarespace each time doesn't work well as I want to be able to edit and sync in real time which Visual Studio Code allows me to do. Link to comment
paul2009 Posted January 3, 2022 Share Posted January 3, 2022 9 hours ago, leaflotus said: The css editor window in Squarespace is so small, I'd rather work in Visual Studio Code and sync to my ftp to make css changes. You can store your CSS file on Squarespace and sync with FTP if you are using Developer Mode on a Squarespace 7.0 site. It isn’t an option on Squarespace 7.1. For an alternative option that will allow you to automatically sync your CSS file with the Custom CSS panel, see the Squarespace Code Connector plugin in the Squarewebsites store. tuanphan 1 Me: I'm Paul, a SQSP user for >18 yrs & Circle Leader since 2017. I value honesty, transparency, diversity and good design ♥. Work: Founder of SF.DIGITAL. We provide high quality original extensions to supercharge your Squarespace website. Content: Views and opinions are my own. Links in my posts may refer to my own SF.DIGITAL products or may be affiliate links. Forum advice is completely free. You can thank me by selecting a feedback emoji. Buying a coffee is generous but optional. Would you like your customers to be able to mark their favourite products in your Squarespace store? 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