{"action":"created","issue":{"url":"https://api.github.com/repos/less/less.js/issues/2629","repository_url":"https://api.github.com/repos/less/less.js","labels_url":"https://api.github.com/repos/less/less.js/issues/2629/labels{/name}","comments_url":"https://api.github.com/repos/less/less.js/issues/2629/comments","events_url":"https://api.github.com/repos/less/less.js/issues/2629/events","html_url":"https://github.com/less/less.js/issues/2629","id":93820560,"node_id":"MDU6SXNzdWU5MzgyMDU2MA==","number":2629,"title":"data-uri function uses path of data-uri call, not the string with the path to the file in.","user":{"login":"lukeapage","id":309321,"node_id":"MDQ6VXNlcjMwOTMyMQ==","avatar_url":"https://avatars1.githubusercontent.com/u/309321?v=4","gravatar_id":"","url":"https://api.github.com/users/lukeapage","html_url":"https://github.com/lukeapage","followers_url":"https://api.github.com/users/lukeapage/followers","following_url":"https://api.github.com/users/lukeapage/following{/other_user}","gists_url":"https://api.github.com/users/lukeapage/gists{/gist_id}","starred_url":"https://api.github.com/users/lukeapage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukeapage/subscriptions","organizations_url":"https://api.github.com/users/lukeapage/orgs","repos_url":"https://api.github.com/users/lukeapage/repos","events_url":"https://api.github.com/users/lukeapage/events{/privacy}","received_events_url":"https://api.github.com/users/lukeapage/received_events","type":"User","site_admin":false},"labels":[{"id":2103265,"node_id":"MDU6TGFiZWwyMTAzMjY1","url":"https://api.github.com/repos/less/less.js/labels/bug","name":"bug","color":"e10c02","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":24,"created_at":"2015-07-08T15:34:26Z","updated_at":"2018-07-29T00:16:27Z","closed_at":null,"author_association":"MEMBER","body":"from https://github.com/less/less.js/issues/2541 but I've seen this in projects\n\n```\n// mixins.less\n.background(@image) {\n    background-image: data-uri(@image);\n}\n```\n\n```\n// app/content/button.less\nbutton {\n  .background(\"images/btn.jpg\");\n}\n```\n\nI would expect the image to be fetched from `app/content/images/btn.jpg` but it is fetched from `images/btn.jpg`.\n\nI welcome feedback on whether this is a breaking change (warranting a major up) or a bug fix.\n"},"comment":{"url":"https://api.github.com/repos/less/less.js/issues/comments/408643107","html_url":"https://github.com/less/less.js/issues/2629#issuecomment-408643107","issue_url":"https://api.github.com/repos/less/less.js/issues/2629","id":408643107,"node_id":"MDEyOklzc3VlQ29tbWVudDQwODY0MzEwNw==","user":{"login":"matthew-dean","id":414752,"node_id":"MDQ6VXNlcjQxNDc1Mg==","avatar_url":"https://avatars1.githubusercontent.com/u/414752?v=4","gravatar_id":"","url":"https://api.github.com/users/matthew-dean","html_url":"https://github.com/matthew-dean","followers_url":"https://api.github.com/users/matthew-dean/followers","following_url":"https://api.github.com/users/matthew-dean/following{/other_user}","gists_url":"https://api.github.com/users/matthew-dean/gists{/gist_id}","starred_url":"https://api.github.com/users/matthew-dean/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matthew-dean/subscriptions","organizations_url":"https://api.github.com/users/matthew-dean/orgs","repos_url":"https://api.github.com/users/matthew-dean/repos","events_url":"https://api.github.com/users/matthew-dean/events{/privacy}","received_events_url":"https://api.github.com/users/matthew-dean/received_events","type":"User","site_admin":false},"created_at":"2018-07-29T00:16:26Z","updated_at":"2018-07-29T00:16:26Z","author_association":"MEMBER","body":"> it to a full output path, based on the location of the file in which the absolute-url function is called, relative to the location where the compiled output CSS file will go.\r\n\r\nAs in, rewrite URLs or rootpath would still apply, but the based on the definition location? That seems a little different than @lukeapage's original example, which was not talking about URLs relative to output, but URLs _during compile_; e.g. the `data-uri()` location.\r\n\r\nSo this issue is a little hard to track because people have posted about similar, but not exactly identical issues. That is, changing a relative _source_ would probably require a much different solution than changing relative _output_. Or perhaps not; it depends on the pathing logic; but we should be clear that data-uri doesn't produce any path as output.\r\n\r\nMaybe we need something like a `resolve()`? I dunno, just spitballing, but `url(resolve(file(), \"my/path\"))`? I guess that's what @miljan-aleksic meant by `absolute()`, in that it would resolve to an absolute URL. But it should still take an input (like `file()`, to resolve against). Otherwise you could do something like `file-resolve()` to designate that logic in one function, but having `resolve()` and `file()` as two functions might be separately useful.\r\n\r\nThe tricky part about all of this is all the rewrite URL options, of which there are now more as of the PR merge that added module support. (https://github.com/less/less.js/pull/3248). So if it returns a file-relative URL, can it still be rewritten? I would assume yes, but we'd need to be clear."}}
{"actor":{"display_login":"matthew-dean"}}