[Question] What to do about @css import?
See original GitHub issueHi!
I’d love to use jte for the rendering of our HTML email templates, however the css styling contains an @import url("https://...");
for a font, which of course is registered as the @import
keyword from jte.
<style type="text/css" rel="stylesheet" media="all">
@import url("https://fonts.googleapis.com/css?family=Nunito+Sans:400,700&display=swap"); /* <--- Right here */
body {
width: 100% !important;
height: 100%;
Thus, this error is generated:
Exception in thread "main" gg.jte.TemplateException: Failed to compile template, error at base-html.jte:14
........./jte-classes/gg/jte/generated/JtebasehtmlGenerated.java:2: error: '.' expected
import url("https://fonts.googleapis.com/css?family=Nunito+Sans:400,700&display=swap");;
^
1 error
The generated file in turn then also includes the import that was actually meant for rendering in CSS:
package gg.jte.generated;
import url("https://fonts.googleapis.com/css?family=Nunito+Sans:400,700&display=swap");;
public final class JtebasehtmlGenerated {
Is there some mechanism to keep these keywords apart, or escape them for jte?
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
import - CSS: Cascading Style Sheets - MDN Web Docs
The @import CSS at-rule is used to import style rules from other valid stylesheets. An @import rule must be defined at the top...
Read more >Best way to include CSS? Why use @import? - Stack Overflow
From a page speed standpoint, @import from a CSS file should almost never be used, as it can prevent stylesheets from being downloaded ......
Read more >What is the best way to include CSS file? Why use @import?
What is the best way to include CSS file? Why use @import? ... CSS property can be include in the HTML page in...
Read more >Questions Parents Asked About the CSS Profile TM - MEFA
A: The CSS Profile will ask you to include all household members who receive more than half of their support from you and...
Read more >How to use @font-face in CSS
This format can also include metadata and license info within the font file. This format seems to be the winner and where all...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Another way would have been
${"@import url('https://fonts.googleapis.com/css?family=Nunito+Sans:400,700&display=swap');"}
, no?@KBurgmann the new plugin version got approved by JetBrains: https://plugins.jetbrains.com/plugin/14521-jte/versions/stable/97316
Now the css looks pretty good in IntelliJ:
I’m gonna close this now 👍