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

handling on @import url in style tag #378

Open
vict-shevchenko opened this issue Jan 13, 2021 · 1 comment
Open

handling on @import url in style tag #378

vict-shevchenko opened this issue Jan 13, 2021 · 1 comment

Comments

@vict-shevchenko
Copy link

Hello,

Can you please advise, I have got a code source code

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <style rel="stylesheet" type="text/css">
    @import url(http://fonts.googleapis.com/css?family=Roboto:400,700,900);

    body {
      color: black;
    }
  </style>
</head>

<body >
</body>
</html>

then I am doing a processing (with grunt-inline-css, which uses jucie under), and my result is:

 <style type="text/css">
@font-face {
  font-family: 'Roboto';
  font-style: italic;
  font-weight: 400;
  src: url(http://fonts.gstatic.com/s/roboto/v20/KFOkCnqEu92Fr1Mu51xIIzc.ttf) format('truetype');}
...
</style>
<body style="color: black;">

How can I avoid processing of @import url so in the result file I will have it unchanged? Something like preserveImports ?

Expected result for my case

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style rel="stylesheet" type="text/css">
    @import url(http://fonts.googleapis.com/css?family=Roboto:400,700,900);
</style>

</head>

<body style="color: black;">

</body>
</html>

Thanks a lot!

@filoscoder
Copy link

I think this will solve it
#442

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