Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Advanced Search
  • 0

Import external css/less



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 post
  • Answers 3
  • Created
  • Last Reply

Top Posters For This Question

3 answers to this question

Recommended Posts

  • 0
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

You can send your question to my email to get detail answer. / How to Setup Password & Share URL 

-- I came back. Will answer soon.

Link to post
  • 0

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 by kristofferdarj
Edit: A clarification that it doesn't work in backend.
Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

  • Create New...