npm list --depth=0)node -v): v8.10.0npm -v): 3.5.2Error in CSS compile when loading an imported Google Font from app.scss
Load a new Laravel project with bootstrap replace the font in app.scss with a google font.
~
composer create-project laravel/laravel quickstart --prefer-dist
composer require laravel/ui
php artisan ui bootsrap
npm install && npm run dev
~
app.scss:
~~~
// Fonts
@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;700&display=swap');
// Variables
@import 'variables';
// Bootstrap
@import '~bootstrap/scss/bootstrap';
~~~
Compiled app.css:
~~~
@import url(https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;
700&display=swap);@charset "UTF-8";
~~~
@gregh Did you find a workaround for now? Other than an import per font weight.
@rbresjer I did not. I was trying to learn Sass and thought it would be better to wait till this is resolved.
I鈥檝e just run into this as well. It looks like the semi-colons are the issue, but I鈥檓 not sure which component is tripping up on them.
Fortunately it is possible to use a slightly different import syntax that bypasses this:
@import url('https://fonts.googleapis.com/css?family=Roboto:500,700');
I pulled that syntax from an older project, so I鈥檓 fairly certain that even if Google have changed the suggested import URLs recently they鈥檙e unlikely to intentionally break the URLs that they were suggesting previously.
Edit: Actually, Google seem to return identical output for these two URLs, so the older syntax shouldn鈥檛 affect functionality at all:
Old syntax:
https://fonts.googleapis.com/css?family=Roboto:500,700,900&display=swap
New syntax:
https://fonts.googleapis.com/css2?family=Roboto:wght@500;700;900&display=swap
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I also came across this today. There is a open issue related to this with a workaround by replacing the semicolons in the URL with %3b:
https://github.com/JeffreyWay/laravel-mix/issues/2430#issuecomment-653915587
I confirm this issue. I dont find the workaround the best one but its something I guess
I'm having the same issue too, the compiler breaks after the semicolon
Most helpful comment
I'm having the same issue too, the compiler breaks after the semicolon