You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think this might be related to the fact that Less no longer auto-switches to a "css" import (preserving the @import statement) just because it finds a "css" string somewhere in the URL.
Reacted by Daniel B, corelgott, Clovis de Villars, Samuel Lissner, Weston Wiatt, Igors Savins, Christian Gaetano, timadona, Martin Mårtensson, niuwanlu and 44 more
Reacted by Martin Mårtensson, Bjorn Breckenridge, Mustafa, David Garcia, Simon Dann, Eduardo Bernardino, Luciano Graziani, Artem Korniev, Andrew Jenkins and enb-valabji
Reacted by Simon Dann, Eduardo Bernardino, Luciano Graziani, DreamAwakening, arnold-parge, ikomom, Andrew Jenkins and enb-valabji
Reacted by Bjorn Breckenridge, xhinar, Simon Dann, Eduardo Bernardino, Luciano Graziani, Andrew Jenkins and enb-valabji
@matthew-dean Is there a way to tell the compiler to use https by default when resolving urls from imports? e.g. when I use @import url(//fonts.googleapis.com/css?family=Open+Sans:400,700);, the output is
When I put this to a page that is loaded via HTTPS, I get a 'mixed content' error and http requests are blocker by browser. So now I have to update all the imports to use (css) or https://..., so just wondering if I could do this with a config option instead?
so just wondering if I could do this with a config option instead?
No. More over the very idea of importing fonts.googleapis.com into a compiled CSS is dangerous because fonts.googleapis.com does sniff the used browser (obvoiusly Less in node will report itself as Chrome/Chromium) and may return different results depending on that (so far I did not heard of any problem in this regards but it is free to break at any moment).
@matthew-dean This is what I did eventually, was just looking for an option to do it via config, so that we don't need to search and update all the places where we use such imports.
Activity
matthew-dean commentedon Mar 20, 2018
I think this might be related to the fact that Less no longer auto-switches to a "css" import (preserving the
@importstatement) just because it finds a "css" string somewhere in the URL.Try
@import (css) url('https://fonts.googleapis.com/css?family=Nunito');rejas commentedon Mar 20, 2018
Awesome @matthew-dean that did help indeed. Thx a lot!
Fix error for less>=3.0.1
Fix error for less>=3.0.1
dmitriy-drenkaliuk commentedon Oct 30, 2019
@matthew-dean Is there a way to tell the compiler to use https by default when resolving urls from imports? e.g. when I use
@import url(//fonts.googleapis.com/css?family=Open+Sans:400,700);, the output isWhen I put this to a page that is loaded via HTTPS, I get a 'mixed content' error and http requests are blocker by browser. So now I have to update all the imports to use
(css)orhttps://..., so just wondering if I could do this with a config option instead?seven-phases-max commentedon Oct 30, 2019
No. More over the very idea of importing
fonts.googleapis.cominto a compiled CSS is dangerous becausefonts.googleapis.comdoes sniff the used browser (obvoiusly Less innodewill report itself as Chrome/Chromium) and may return different results depending on that (so far I did not heard of any problem in this regards but it is free to break at any moment).matthew-dean commentedon Oct 30, 2019
@dmitriy-drenkalyuk Why not just write:
@import url(https://fonts.googleapis.com/css?family=Open+Sans:400,700);?
dmitriy-drenkaliuk commentedon Nov 22, 2019
@matthew-dean This is what I did eventually, was just looking for an option to do it via config, so that we don't need to search and update all the places where we use such imports.