mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-12-28 02:23:25 +00:00
[GITEA] Maintain aspect ratio for auth icons
- 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
(cherry picked from commit 3482739637
)
This commit is contained in:
parent
b97ab04e8f
commit
0b3b13c8d5
|
@ -56,7 +56,7 @@ func (p *AuthSourceProvider) DisplayName() string {
|
|||
|
||||
func (p *AuthSourceProvider) IconHTML() template.HTML {
|
||||
if p.iconURL != "" {
|
||||
img := fmt.Sprintf(`<img class="gt-mr-3" width="20" height="20" src="%s" alt="%s">`,
|
||||
img := fmt.Sprintf(`<img class="gt-mr-3 oauth-provider-icon" src="%s" alt="%s">`,
|
||||
html.EscapeString(p.iconURL), html.EscapeString(p.DisplayName()),
|
||||
)
|
||||
return template.HTML(img)
|
||||
|
|
|
@ -2289,3 +2289,8 @@ table th[data-sortt-desc] .svg {
|
|||
flex-wrap: wrap;
|
||||
gap: .25rem;
|
||||
}
|
||||
|
||||
.oauth-provider-icon {
|
||||
max-height: 20px;
|
||||
max-width: 20px;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue