Closed nicola-lunghi closed 3 years ago
The base path of CSS will be always same as .md
file because CSS theme will bundle to Marp presentation as the inline stylesheet.
Surely it seems like counterintuitive so preprocessing for relative URL resolution in Marp (or Marpit framework) may be good.
These are workarounds:
https://
for assets (Marp recommends to upload assets into online due to prevent security problems by third-party themes).If you want advanced conversion and batch processing, we recommend to use Marp CLI. The VS Code extension has intentionally designed for a simple workflow.
I've came across a similar issue. To make things simple, I embedded the images (in base64) into a CSS file directly - this is not a perfect solution, it is more a workaround, but works on VSCode and CLI.
Something like this:
background-image: url(data:image/png;base64,----PLAECE HERE THE IMAGE ENCODED IN BASE64----);
The CSS will become quite larger with images, specially because base46 encoding uses more bytes So far, I've not had any performance issues.
Close to keep cleaning issue tracker. marp-team/marp#86 also has discussed about this issue so please use GitHub Discussions to continue.
Hi,
I have the following directory structure
I want to use in my custom theme some custom images (logo and bg) that are in the main assets folder.
The problem is that it seems that the path for the css are relative to the presentation file and not to the css. Also there's a way in which I can tell vscode where to put my files instead of selecting every time the folder? Like to batch make all the files?
Thanks Nick