Simple URL Encode Function for Less
Put the urlencode.less.js
file in your project and include the following in your Less file:
@plugin 'path/to/urlencode.less.js';
Then you can use the urlencode()
function anywhere.
urlencode()
accepts a string which it will return, unquoted and URL encoded (using JavaScript's encodeURIComponent()
).