XF 2.1 170x250 avatar sizes

kray

Member
So how can i enlarge my avatar size to 170x250 without the picture covering stuff it shouldn't.

An example:

VW5TQpn.png
 
I just used this code and replaced the dimensions with the ones I wanted to use and replaced height with auto and it works like gangbusters!

Thank you so much @XenArabia! I really appreciate your help!
Code:
.avatar.avatar--o {
    max-width: 150px;
    width: 150px;
    height: auto;
    max-height: 200px;
}
@kray if you use auto on the height and fill in the max-height to whatever you want there's no stretching.

tumblr_pozvklcdiw1r43lwqo1_400.png


It works!


I've got this

Code:
.avatar.avatar--o {
    max-width: 150px;
    width: 150px;
    height: auto;
    max-height: 350px;
}

Code:
<xf:avatar user="$user" size="o" defaultname="{$fallbackName}" itemprop="image" />

yet nothing changes. Did I miss something?
 
Did you replace this line in message_macros?
Code:
<xf:avatar user="$user" size="o" defaultname="{$fallbackName}" itemprop="image" />

I did yeah. Could it be because the style (flatawesome+) im using is preventing it from doing so?


Edit: It works on default style, but flatawesome+ is preventing the code to go through
 
Last edited:
I did yeah. Could it be because the style (flatawesome+) im using is preventing it from doing so?


Edit: It works on default style, but flatawesome+ is preventing the code to go through
I got it to work on Pixel's Core style. So there may be something blocking you, but it's hard to say.
 
Core has a similar property page and I was able to get it. As long as you swapped l for o in the message macros that style option doesn’t matter. Because after selecting Large there your style will swap it with the o css you put in extra.less.

If you changed the height to auto there should be no more stretching.
 
Core has a similar property page and I was able to get it. As long as you swapped l for o in the message macros that style option doesn’t matter. Because after selecting Large there your style will swap it with the o css you put in extra.less.

If you changed the height to auto there should be no more stretching.

It works perfectly on the default style. Would you mind trying it on flatawesome+, or be willing to fix it on my site?
 
Increase the size of the avatar in the version 2.2

extra.less :

CSS:
.avatar.avatar--o {
max-width: 165px;
width: auto;
height: auto;
max-height: 310px;
}

message_macros :

Look for :
CSS:
<xf:avatar user="$user" size="m" defaultname="{$fallbackName}" itemprop="image" />
on line 8

Change character "m" to "o"
To be as
CSS:
<xf:avatar user="$user" size="o" defaultname="{$fallbackName}" itemprop="image" />
Then go
-
Style settings - Messages - Message user info block width :
Change 120px to 160px
save

Attached example
 

Attachments

  • 9.webp
    9.webp
    20.9 KB · Views: 11
Bumping this thread, since I am having the same issue. I tried adding the code from the above post, but the avatar remains the same. I'm looking to keep the same height as below, but make it more of a horizontal rectangle.
avatar1.webp

Here is the code I added to extra.less:
avatar2.webp
And to message_macros:
avatar3.webp
And this is what happened!
avatar4.webp

Can someone help? Not sure what is going on. If I remove the "auto" fields and replace them with pixels, the image goes back to the default size.
 
Top Bottom