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

Transparent images broken with regular []() tags but not with [bg]() #371

Closed
ymollard opened this issue Apr 25, 2024 · 2 comments
Closed

Comments

@ymollard
Copy link

I made an example code to demonstrate that issue:

Deployment: https://candid-tulumba-47300d.netlify.app/
Code: https://gitlab.com/ymollard/test-marp-img-bng/-/blob/main/index.md

Expected behaviour: transparent background for both Python logos using the []() tag and [bg]()
Actual behaviour: transparent background only for [bg]() but not for []().

@yhatt
Copy link
Member

yhatt commented Apr 25, 2024

Aren't you using Marp Core's default theme?

default theme has an inherited style from GitHub's Markdown rendering. Markdown images in GitHub by ![]() actually has colored background inherited from GitHub's background.
https://github.com/sindresorhus/github-markdown-css/blob/b3977a0367f753d1c58812c4218f69f013504c51/github-markdown.css#L216-L221

marp-default-theme-bg

You can tweak the style within Markdown to remove inherited background color:

<style>
img {
  background-color: transparent;
}
</style>

Related

@ymollard
Copy link
Author

Yes, theme: gaia works properly but the default does not. The manual img {} also fixes the issue.
So if I understand well, it's not a bug, it's a feature, so I close that issue.
Thanks for the fast and complete answer!

@yhatt yhatt transferred this issue from marp-team/marpit Apr 25, 2024
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

2 participants