Closed Zebzhong closed 1 year ago
less version: 4.1.3 node version: 14.x os: windows 10
code
const less = require("less"); let lessStr = ` @color1: 'blue'; @imgUrl: ''; @furl: 'https://qq.com'; body{ color: @color1; } .myImg { background: url('@{imgUrl}') no-repeat; background-size: contain; width: 200px; height: 200px; } @font-face { font-family: 'zbtest'; src: "url('@{furl}')"; } .root { font-family: 'zbtest'; } ` less .render(lessStr, { modifyVars: { color1: 'skyblue', imgUrl: '../test/qe.png', furl: "https://www.baidu.com" }, }) .then((res) => { console.log(res); });
result
hope Can replace externals url variables correctly, Thanks
Originally posted by @Zebzhong in https://github.com/less/less.js/discussions/3752
repeat
less version: 4.1.3 node version: 14.x os: windows 10
code
result![image](https://user-images.githubusercontent.com/29706072/191479082-0be3a950-4b63-4480-b978-838718651609.png)
hope Can replace externals url variables correctly, Thanks
Originally posted by @Zebzhong in https://github.com/less/less.js/discussions/3752