Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on style @import font #54

Open
srocerer opened this issue Apr 29, 2018 · 1 comment
Open

Error on style @import font #54

srocerer opened this issue Apr 29, 2018 · 1 comment

Comments

@srocerer
Copy link

Error message:

Message:
8: ")" not found

After added this conditional tags

<!--[if !mso]><!-- -->
	<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700,900&amp;subset=latin-ext" rel="stylesheet" type="text/css">
	<style type="text/css">
		@import url(https://fonts.googleapis.com/css?family=Roboto:300,400,500,700,900&amp;subset=latin-ext);
	</style>
	<!--<![endif]-->
@srocerer srocerer changed the title Does not work with if !mso Error on style @import font Apr 29, 2018
@neemzy
Copy link

neemzy commented Dec 7, 2021

@srocevas I reckon you found a way around this somehow since then, but in case you never figured out the problem, it is caused by the semicolon (;) in your @import statement:

@import url(https://fonts.googleapis.com/css?family=Roboto:300,400,500,700,900&amp;subset=latin-ext);

You should be able to use the ampersand (&) directly without URL-encoding it to &amp;:

@import url(https://fonts.googleapis.com/css?family=Roboto:300,400,500,700,900&subset=latin-ext);

In my case, the issue (still) arises because of Google Fonts API v2's use of semicolons in their new syntax for individual weights:

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;700&display=swap');

The only workaround I found so far consists of using a weight range (..) instead:

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400..700&display=swap');

@jonkemp Would it be possible for you to look into this?

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

No branches or pull requests

2 participants