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

Limit the size of image #24

Merged
merged 2 commits into from
Jun 17, 2022
Merged

Conversation

Rongronggg9
Copy link
Contributor

Pre: so huge, hard to read!

Post: fantastic

Note:

Why not style="max-width: ***"?
It is unsupported by GitHub. But style="width: ***" behaves nearly the same as the former in GitHub-flavored Markdown.

Why 8em?
It can be any reasonable value you like.

Why style="width: 8em" cannot unify the image size anywhere?
Just mentioned, it behaves nearly the same as style="max-width: 8em" in GitHub-flavored Markdown.

@yaniraton
Copy link

I think you're really right and it's really hard to read

@Schweinepriester
Copy link
Owner

Schweinepriester commented Jun 16, 2022

Esp. for the tier images I agree (thought about that before, in #5), but do you know of a way to make the images in all tables the same size, preferably with the same value?
Because currently, also on your branch, the images in the "Achievements" table are being forced smaller than width: 8em; - namely 101px only instead of 128px.

EDIT: And also without crafting a custom <table>.

@Rongronggg9
Copy link
Contributor Author

Rongronggg9 commented Jun 17, 2022

do you know of a way to make the images in all tables the same size, preferably with the same value?
EDIT: And also without crafting a custom <table>.

It seems impossible. GitHub does not really respect styles set by users but always adjusts sizes dynamically, that's why I said "style="width: 8em" behaves nearly the same as style="max-width: 8em" in GitHub-flavored Markdown". Here, the first table ("Achievements") contains columns with too many words, making GitHub dynamically adjust the image size. In such a case, setting style="width: 8em" effectively zooms out the images compared to before, but GitHub is not satisfied, so it zooms them out again...

Setting the width with other units won't help. Maybe making feedback to GitHub is the best choice.


You may prove my statements by comparing two pages rendering README.md with different box widths:

https://github.com/Rongronggg9/github-profile-achievements/tree/4baec4417d8f4b992dccde2983a5b9e85da340f8

and https://github.com/Rongronggg9/github-profile-achievements/blob/4baec4417d8f4b992dccde2983a5b9e85da340f8/README.md

@Schweinepriester
Copy link
Owner

Hrm, really unsatisfying currently.
I've been trying something like this:

achievements: width: 256px => 164px
=> tiers: 164px

which works to make them the same size, but then we'd have to adjust all values all time, meh.

Maybe eventually I have to experiment with a custom <table>.

For now I will only set width to the tier images, to match them to the size of the achievements when viewing https://github.com/Schweinepriester/github-profile-achievements (not the full width view), so approx 180px.

I will use your PR to give you props. Thank you! :)
Feel free to open another one if you have further ideas.

@Schweinepriester Schweinepriester merged commit 1a7bade into Schweinepriester:main Jun 17, 2022
@Rongronggg9
Copy link
Contributor Author

Rongronggg9 commented Jun 17, 2022

which works to make them the same size
approx 180px.

Just a reminder, the width of the box is also dynamic according to per user's screen size. So your patch may look like this:

@Schweinepriester
Copy link
Owner

Yeah, but that's at least less bad than it was, right?
So the tier images are now at most 180px, as opposed to before when they could grow even larger (to the full 296px), like your very first image.

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

Successfully merging this pull request may close these issues.

3 participants