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 in issue texts makes them unreadable #983

Closed
HolgerJeromin opened this issue Aug 16, 2019 · 8 comments
Closed

Transparent images in issue texts makes them unreadable #983

HolgerJeromin opened this issue Aug 16, 2019 · 8 comments
Labels
bug 🐛 Something isn't working

Comments

@HolgerJeromin
Copy link

This repo issues often have transparent images.

  • Screenshot:
    image
    and
    image

ref #463

@HolgerJeromin HolgerJeromin added the bug 🐛 Something isn't working label Aug 16, 2019
@Mottie
Copy link
Member

Mottie commented Aug 16, 2019

Hi @HolgerJeromin!

Hmm, I thought we had the background change to white on hover:

.markdown-body img:hover {
    background-color: #fff !important;
}

But I don't see it any more.

@xt0rted
Copy link
Member

xt0rted commented Aug 16, 2019

@Mottie the white background on hover was only when viewing an image in a repo such as this https://github.com/StylishThemes/logos/blob/master/github.dark/githubdark.svg

@silverwind
Copy link
Member

Seems like that background effect could be done to all images inside .markdown-body

@the-j0k3r
Copy link
Member

the-j0k3r commented Aug 27, 2019

@Mottie the white background on hover was only when viewing an image in a repo such as this https://github.com/StylishThemes/logos/blob/master/github.dark/githubdark.svg

If I remember this right, the only effect was for jupyter notebooks images #846 and a page https://github.com/sujitpal/statlearning-notebooks/blob/master/src/chapter2.ipynb

None of the issue reported here are encompassed in that.

Seems like that background effect could be done to all images inside .markdown-body

Edit

I disagree, not all images in markdown body benefit from this, need a more specific selector to handle these without altering all images.

Ah, seems by default all images have a white bg.

.markdown-body img {
	background-color: #fff;
	box-sizing: content-box;
	max-width: 100%;
}

Though this stuff is woven into the generator

also its interesting that the images in gravitystorm/openstreetmap-carto#120 (comment) are dark and many other similar images posted in that topic are not.

Why are we exactly changing this? I reverted this to white as per default and cant see any ill effects

@HolgerJeromin
Copy link
Author

also its interesting that the images in gravitystorm/openstreetmap-carto#120 (comment) are dark and many other similar images posted in that topic are not.

The others are PNG without transparency but white background in the image itself.

Why are we exactly changing this? I reverted this to white as per default and cant see any ill effects

Fine with me.

@the-j0k3r
Copy link
Member

the-j0k3r commented Aug 28, 2019

Why are we exactly changing this? I reverted this to white as per default and cant see any ill effects

@HolgerJeromin

Thats a question more for @Mottie @silverwind @xt0rted cause I cant remember why this was changed, there has to be some reason that escapes me right now.

As is it seems to me that it was just caught up in the generator rule, so Im wondering some exclusion may be a better fix.

@the-j0k3r
Copy link
Member

the-j0k3r commented Aug 29, 2019

AH I see it, all emoji and other images rendered to png are affected by this, I dont even think the hover solution is nice cause it looks nasty when hovering things around.

I think we should make this optional with a toggle in style settings to restore the white bg if a user prefers it, though with the following CSS (removing the generator portions) seems to be acceptable,

	.markdown-body img[data-canonical-src*="svg"], .markdown-body img.emoji {
		background-color: inherit !important;
	}
	.markdown-body img[src*="png"] {
		background-color: #ccc;
	}

The top handles our svg images in readme + the emoji the bottom handles the issue,

the-j0k3r added a commit that referenced this issue Feb 24, 2020
@the-j0k3r the-j0k3r mentioned this issue Feb 24, 2020
the-j0k3r added a commit that referenced this issue Feb 24, 2020
the-j0k3r added a commit that referenced this issue Feb 25, 2020
the-j0k3r added a commit to StylishThemes/Feature-Override-Styles that referenced this issue Feb 25, 2020
the-j0k3r added a commit to StylishThemes/Feature-Override-Styles that referenced this issue Feb 25, 2020
* chore(meta): add GitHub Dark IMG Background (the-j0k3r)
* chore(add): github-dark-img-bg-clr resolves StylishThemes/GitHub-Dark#983 (the-j0k3r)
* More readme changes (Rob Garrison)
* Organize readme (Rob Garrison)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants