less / less/less.js

handle relative URLs in live mode

Open
#1,926 11 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

The less live compiler appears to not resolve relative URLs correctly.

When using a file eg "/static/foo/bar/main.less" any url() statements encountered should be resolved relative to that as a base URL. Currently they are passed through unchanged and, because the compiled CSS is included in-line all the URLs are resolved relative to the base of the web page.

url("../../fonts/foo.woff") should become url("/static/fonts/foo.woff")

url("./foo.img") should become url("/static/foo/bar/foo.img")

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

No file or test is named. Start by tracing the Less live compiler's handling of url() values and reproduce the examples in the issue; done means relative URLs resolve against /static/foo/bar/main.less's directory instead of the web page base.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
compilers, web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.