Skip to content

File paths in custom CSS #86

Answered by yhatt
m4ttr4ymond asked this question in Q&A
Discussion options

You must be logged in to vote

As Marp team's position, we don't recommend to use local image assets because Marp treats as that using local file has some potential security risks (e.g. Marp CLI requires manually setting --allow-local-files).

Workarounds have already discussed in the same issue marp-team/marp-vscode#181. You can take following either one:

  • Use online assets through URL started with https://. For example, D&D your image to GitHub's textbox and use the uploaded image via background-image: url('https://user-images.githubusercontent.com/...');. (Disclaimer: It's not always retained for the future)
  • Include assets as base64-encoded string into theme CSS, by converting images on build time. Marp Core has ta…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@m4ttr4ymond
Comment options

Answer selected by m4ttr4ymond
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants