Can not link external css file
db-conception opened this issue · comments
db-conception commented
Hello,
I am trying to link an external css file. But it doesn't works
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>DECLARATION DE NON-CONDAMNATION et de FILIATION</title>
<link href="style.css" rel="stylesheet">
</head>
Andrea Simeoni commented
Any help out there?
db-conception commented
Any help out there?
As temporary solution, I use fs to read the css file, and inject it inside the template using {{ this.styles }}
db-conception commented
Any help out there?
var fs = require("fs");
var path = require("path");
// get css from style file
const cssRules = fs.readFileSync(
path.join(process.cwd(), "./template/commun/style.css"),
"utf8"
);
// merge computed datas to data object
data.styles = cssRules;
Carlos Estrada commented
Any help out there?
I can link the css file, but I only test this with the localhost.
<link href="http://localhost:3000/css/style.css" rel="stylesheet"/>
Isrolik-MorYosef commented
@db-conception U can attachment the HTML file?
Miguel Bazán commented
In my case, the CSS wasn't loading because it could not load the images.
I mean, there was a error with my images when the PDF was created.
I hope this be useful.