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

CSS don't load #108

Open
ismailkoksal opened this issue Apr 8, 2021 · 4 comments
Open

CSS don't load #108

ismailkoksal opened this issue Apr 8, 2021 · 4 comments

Comments

@ismailkoksal
Copy link

I can't load my css

Project structure

src/
templates/
  index/
    css/
      style.css
    html.hbs

app.module.ts

PDFModule.register({
      isGlobal: true,
      view: {
        root: join(__dirname, '..', 'templates'),
        engine: 'handlebars',
        extension: 'hbs',
      },
    }),

html.hbs

<html>
<head>
  <link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"
        integrity="sha384-eOJMYsd53ii+scO/bJGFsiCZc+5NDVN2yr8+0RDqr0Ql0h+rP48ckxlpbzKgwra6" crossorigin="anonymous">
  <link href="css/style.css" rel="stylesheet">
</head>
<body>
  <h1 class="red">Hello World</h1>
</body>
</html>

style.css

.red {
  color: red;
}
@dacxjo
Copy link

dacxjo commented May 24, 2021

@ismailkoksal Did you solve this?

@ismailkoksal
Copy link
Author

@ismailkoksal Did you solve this?

@dacxjo No, i decided to put CSS in the HBS file.

@telou1
Copy link

telou1 commented Jan 17, 2022

HI,

this is working for me:

> root/
  > assets/
       > stylesheets/
            > style.css

file.pug:

head
meta(charset="UTF-8")
meta(name="viewport", content="width=device-width, initial-scale=1.0")
style
include ../stylesheets/style.css

@dacxjo
Copy link

dacxjo commented Jan 17, 2022

Thanks but I have uninstalled this package, instead, I'm using puppeteer with his pdf method to generate my documents

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

3 participants