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

Fit large images in the window when viewing single files #5754

Merged
merged 4 commits into from
Jun 30, 2022
Merged

Fit large images in the window when viewing single files #5754

merged 4 commits into from
Jun 30, 2022

Conversation

Katsute
Copy link
Contributor

@Katsute Katsute commented Jun 29, 2022

Closes #5740

Adds the following css to restrict image blob sizes:

div[data-target='readme-toc.content'] div.blob-wrapper img {
	max-width: 100%;
}

Test URLs

https://github.com/KatsuteDev/Mal4J/blob/main/assets/banner-sq.png

Screenshot

github com_KatsuteDev_Mal4J_blob_main_assets_banner-sq png (2)

@Katsute Katsute marked this pull request as ready for review June 29, 2022 20:13
@fregante
Copy link
Member

Thank you!

This doesn't affect images in commits, which is good 👍

4218456#diff-f44b12b0416bb268cf2491ea46a5f8deae4823068722a5bfcc61d0f87d371169

@Katsute
Copy link
Contributor Author

Katsute commented Jun 29, 2022

It only limits the max size of images, it shouldn't affect any images that are smaller.

Copy link
Member

@fregante fregante left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

source/refined-github.css Outdated Show resolved Hide resolved
source/refined-github.css Outdated Show resolved Hide resolved
@fregante fregante changed the title Resize large image blob previews Fit large images in the window when viewing single files Jun 29, 2022
Katsute and others added 2 commits June 29, 2022 16:23
Co-authored-by: Federico Brigante <me@fregante.com>
@Katsute
Copy link
Contributor Author

Katsute commented Jun 29, 2022

CSS only runs on blob image previews because of div[data-target='readme-toc.content'], diffs don't have this div so it should be safe to use.

@fregante fregante merged commit c42c744 into refined-github:main Jun 30, 2022
@Katsute Katsute deleted the image-preview-max branch July 5, 2022 01:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

Max image size for image previews
4 participants