less / less/less.js

Linking or importing LESS file on another host doesn't work.

Open
#1,377 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

browser bug medium priority
Dominant language
JavaScript
Stars
17k
Forks
3.4k
Avg merge
7h 42m
Merged PRs (30d)
26

Description

I'm using LESS client-side. LESS doesn't seem to process a file if it's on another host, if it's linked either via in HTML file or @import in LESS file. I'm trying to do the following.

I have several websites on different hosts, e.g., http://qwe.com and http://asd.com. All of them should have similar design coming from a common LESS stylesheet, but with several site specific parameters (colors, logo, etc.). This common stylesheet is stored as http://qwe.com/common.less. Each site has it's own stylesheet "style.less" that contains something like this:
"
@color1: #73B5DD;
...
@colorN: #080808;

@import (less) url("http://qwe.com/common.less");

.some_local_rule { margin: 0; }
...
...
"
It seems to work only if "common.less" is on the same host. Otherwise, no error is reported, but also there is no style.

The same happens, if I link a LESS file on another host directly from HTML using .

To be more precise, I'm currently doing it locally using several ports, e.g. http://localhost:1001/ and http://localhost:8000/ instead of http://qwe.com and http://asd.com. But I assume the problem is the same.

Is there any solution?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the client-side case using a linked or @imported stylesheet across the localhost:1001 and localhost:8000 hosts described in the issue. Investigate how cross-host LESS resources are handled; done means the reported behavior has a documented solution or a verified fix, with no silent failure.

Written by the indexing model from the issue text.

Assessment

Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.