Skip to content

Compiler doesn't import some remote CSS files #27

@viniciusfabri

Description

@viniciusfabri

Steps to reproduce (*)

  1. On a .less file, import the following URL: @import url("https://fonts.googleapis.com/icon?family=Material+Icons");
  2. Compile LESS

Expected result (*)

  • Font is imported correctly

Actual result (*)

  • We get this error: File https://fonts.googleapis.com/icon not found

Root cause

We originally found this issue in Magento 2: magento/magento2#25119

We were able to track down the issue down to the less.php library. This URL doesn't work because it doesn't have the "css" word in it, which the library takes into account when importing css files: https://github.com/wikimedia/less.php/blob/master/lib/Less/Tree/Import.php#L44

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions