[resolved] Root-relative paths (6 posts)

  1. Marcus Fridholm
    Posted 3 years ago #

    I got irritated on an in all other respects superb plugin, because I needed to be able to set paths relative to root.

    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 = str_replace(
          array($token.'/', $token.'data:', $token),
          array('/', 'data:', dirname($stylesheet->getSourceUri()).'/'),

    Adding the "/" as a valid variant, just as "data:".

    Hope this helps someone :D


  2. oncletom
    Plugin Author

    Posted 2 years ago #

    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?

  3. oncletom
    Plugin Author

    Posted 2 years ago #

    Your problem may has been fixed within [this issue](https://github.com/oncletom/wp-less/pull/19) and in release 1.5.1

  4. Marcus Fridholm
    Posted 2 years ago #

    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.

  5. oncletom
    Plugin Author

    Posted 2 years ago #

    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 :-)

  6. Marcus Fridholm
    Posted 2 years ago #

    Yes that is not your fault, but a library problem. I shared it more as a "heads-up".

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic