Jump to content

Anyone else having issues with LESS.php inlining .css without adjusting relative urls?


gornycreative
 Share

Recommended Posts

I don't know if this is a bug or a feature, but I discovered when trying to

@import (optional, inline) '/path/to/some/file.css'

The code from the css file is brought into LESS but the relative url references do not get adjusted (thus they break).

A standard LESS @import of css happens like any other type of import. I was trying to consolidate my css.

So as an example, I'm trying to import a css that declares a font-face:

@font-face {
    font-family: 'Acherus Grotesque';
    src: url('acherus_grotesque_-_regular-webfont.woff2') format('woff2'),
         url('acherus_grotesque_-_regular-webfont.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}

The css file resides in a subdirectory with the font files - pretty typical.

It works fine when I run it as @import (optional), but when I bring it inline it shows up unmodified in the final LESS.

As a result, it looks for font files in the site/assets/ folder where the admin.css file gets written.

Is there a workaround/option I'm missing? I've tried setting the option to process as less files - no difference.

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...