Skip to content

Parsing @import in CSS causes style loss #558

@yinzsw

Description

@yinzsw

Expected Behavior

access addr http://127.0.0.1:8080/home
click button exec htmlToImage.toJpeg(dom, {quality: 0.75})

/*<link rel="stylesheet" href="static/vue/component/index.css" />*/

@import "assets/common.css";
/*http://127.0.0.1:8080/static/vue/component/assets/common.css*/
@import "ex-menu/index.css";
/*http://127.0.0.1:8080/static/vue/component/ex-menu/index.css*/

Current Behavior

access addr http://127.0.0.1:8080/home
click button exec htmlToImage.toJpeg(dom, {quality: 0.75})

/*<link rel="stylesheet" href="static/vue/component/index.css" />*/

@import "assets/common.css";
/*http://127.0.0.1:8080/assets/common.css 404*/
@import "ex-menu/index.css";
/*http://127.0.0.1:8080/ex-menu/index.css 404*/

Possible Solution

Steps To Reproduce

  1. ...
  2. ...
  3. ...
Error Message & Stack Trace

<!-- Provide a log message if relevant -->

Additional Context

Your Environment

  • html-to-image: 1.11.13
  • OS: arch linux Linux 6.16.1-arch1-1.1-g14
  • Browser: chromium 139.0.7258.154

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions