Title: [Plugin: WP-LESS] Root-relative paths
Last modified: August 20, 2016

---

# [Plugin: WP-LESS] Root-relative paths

 *  Resolved [Marcus Fridholm](https://wordpress.org/support/users/marcusfridholm/)
 * (@marcusfridholm)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/plugin-wp-less-root-relative-paths/)
 * I got irritated on an in all other respects superb plugin, because I needed to
   be able to set paths relative to root.
 * Example:
    background: url(/path/to/image);
 * So I dug into it and in the file Plugin.class.php I found the solution. In the
   function filterStylesheetUri I changed the lines:
 *     ```
       $css = str_replace(
             array($token.'data:', $token),
             array('data:', dirname($stylesheet->getSourceUri()).'/'),
           $css);
       ```
   
 * to:
 *     ```
       $css = str_replace(
             array($token.'/', $token.'data:', $token),
             array('/', 'data:', dirname($stylesheet->getSourceUri()).'/'),
           $css);
       ```
   
 * Adding the “/” as a valid variant, just as “data:”.
 * Hope this helps someone 😀
 * [http://wordpress.org/extend/plugins/wp-less/](http://wordpress.org/extend/plugins/wp-less/)

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Author [thom4](https://wordpress.org/support/users/oncletom/)
 * (@oncletom)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/plugin-wp-less-root-relative-paths/#post-2832231)
 * Hi Marcus, thanks for your tip.
 * Would you recommend something special so as I could help you to push those things
   to be a built-in feature?
 *  Plugin Author [thom4](https://wordpress.org/support/users/oncletom/)
 * (@oncletom)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/plugin-wp-less-root-relative-paths/#post-2832247)
 * Your problem may has been fixed within [this issue]([https://github.com/oncletom/wp-less/pull/19](https://github.com/oncletom/wp-less/pull/19))
   and in release `1.5.1`
 *  Thread Starter [Marcus Fridholm](https://wordpress.org/support/users/marcusfridholm/)
 * (@marcusfridholm)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/plugin-wp-less-root-relative-paths/#post-2832253)
 * Actually the only thing that bugs me, is lessc and how it chokes on some constructs
   like:
    *rule: value;
 * This means som IE-specific code in Twitter Bootstrap creates errors on compilation.
   
   I’ve not dug into it to see why, rather I just commented out the offending lines,
   since they were not strictly necessary. But it still is slightly irritating if
   lessc can’t handle such mainstream code.
 * This might or might not be a real problem, depending on versions of lessc and
   TB.
 * If it stays a problem, and if I have the time to do something about it, I’ll 
   let you know.
 *  Plugin Author [thom4](https://wordpress.org/support/users/oncletom/)
 * (@oncletom)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/plugin-wp-less-root-relative-paths/#post-2832254)
 * Fine. It’s more a library-specific problem but if I can ease stuff, I’ll do.
 * Thanks for have taken time to share that 🙂
 *  Thread Starter [Marcus Fridholm](https://wordpress.org/support/users/marcusfridholm/)
 * (@marcusfridholm)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/plugin-wp-less-root-relative-paths/#post-2832255)
 * Yes that is not your fault, but a library problem. I shared it more as a “heads-
   up”.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘[Plugin: WP-LESS] Root-relative paths’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wp-less.svg)
 * [WP-LESS](https://wordpress.org/plugins/wp-less/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-less/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-less/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-less/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-less/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-less/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [Marcus Fridholm](https://wordpress.org/support/users/marcusfridholm/)
 * Last activity: [13 years, 5 months ago](https://wordpress.org/support/topic/plugin-wp-less-root-relative-paths/#post-2832255)
 * Status: resolved