WordPress.org

Ready to get started?Download WordPress

Forums

WP-LESS
[resolved] Root-relative paths (6 posts)

  1. Marcus Fridholm
    Member
    Posted 1 year ago #

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

    http://wordpress.org/extend/plugins/wp-less/

  2. oncletom
    Member
    Plugin Author

    Posted 1 year 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
    Member
    Plugin Author

    Posted 1 year 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
    Member
    Posted 1 year 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
    Member
    Plugin Author

    Posted 1 year 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
    Member
    Posted 1 year 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

About this Topic