Skip to content
This repository has been archived by the owner on Jan 9, 2019. It is now read-only.

protocol independent googleapis font import throws IOException saying .less not found #73

Open
nitinsurana opened this issue Sep 16, 2015 · 4 comments

Comments

@nitinsurana
Copy link

I have the below line in of my .less files

@import url("//fonts.googleapis.com/css?family=Open+Sans:300,400,600,700&lang=en");

While building the project, it throws the following error :

java.io.IOException: Resource E:\mongrel\mongrel\src\main\webapp\webresources\css\edulastic\less\theme\fonts.googleapis.
com\css?family=Open+Sans:300,400,600,700&lang=en.less not found.
@nitinsurana nitinsurana changed the title protocol independent googleapis font import protocol independent googleapis font import throws IOException saying .less not found Sep 16, 2015
@nitinsurana
Copy link
Author

For others stumbling upon this issue, here is the temporary fix I used :

Added .css at the end of the url by adding a random parameter. Imports having an extension .css are ignored.

@import url("//fonts.googleapis.com/css?family=Open+Sans:300,400,600,700&lang=en&random=.css");

@agabrys
Copy link

agabrys commented Sep 17, 2015

You can add css option to import rule instead of .css extension hack.

@import (css) url("//fonts.googleapis.com/css?family=Open+Sans:300,400,600,700&lang=en");

@nitinsurana
Copy link
Author

@agabrys quickly tested and it works as expected, thanks.

@nitinsurana
Copy link
Author

Now, I want to import .css file in the final less compiled, is there a way, since .css are actually ignored from importing ?

@import url("../plugins/toastr/toastr.min.css"); - Doesn't import it in the final less compiled.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants