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

maintain aspect ratio for auth icons #26488

Closed
wants to merge 1 commit into from

Conversation

earl-warren
Copy link
Contributor

  • When specifying an icon URL for a authentication source, it's forced to be an width and height of 20px. However this didn't take into account that icons could have an different aspect ratio of 1:1.
  • This patch fixes that by instead using max-width and max-height which will respect other aspect ratios.
  • Resolves https://codeberg.org/forgejo/forgejo/issues/1234

Refs: https://codeberg.org/forgejo/forgejo/pulls/1241

(cherry picked from commit bd915b867057c1aaae1b4a33a83a5703cabda462)

- When specifying an icon URL for a authentication source, it's forced
to be an width and height of 20px. However this didn't take into account
that icons could have an different aspect ratio of 1:1.
- This patch fixes that by instead using `max-width` and `max-height`
which will respect other aspect ratios.
- Resolves https://codeberg.org/forgejo/forgejo/issues/1234

Refs: https://codeberg.org/forgejo/forgejo/pulls/1241

(cherry picked from commit bd915b867057c1aaae1b4a33a83a5703cabda462)
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Aug 14, 2023
@pull-request-size pull-request-size bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Aug 14, 2023
@lunny lunny added the topic/ui Change the appearance of the Gitea UI label Aug 14, 2023
@lunny lunny added this to the 1.21.0 milestone Aug 14, 2023
@wxiaoguang
Copy link
Contributor

This change is not right. For example, a SVG with width=16 and height=16

I will fix it by a correct approach.

@silverwind
Copy link
Member

silverwind commented Aug 14, 2023

Likely needs CSS aspect-ratio or object-fit, or both. Likely just copy the approach done for avatars.

@wxiaoguang
Copy link
Contributor

wxiaoguang commented Aug 14, 2023

Yup, the "object-fit" is a right approach

@GiteaBot GiteaBot removed this from the 1.21.0 milestone Aug 15, 2023
@go-gitea go-gitea locked as resolved and limited conversation to collaborators Nov 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. topic/ui Change the appearance of the Gitea UI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants