To increase the avatar size from 45px (default) to max 120px add the code above in your customize > themes > Desktop > CSS tab
(I mean, do you really need avatars bigger than 120px? )
In the example above I increased the avatarās size to 90px and repositioned it
/*Increase avatars*/
.topic-avatar {
width: 90px;
.avatar {
width: 90px;
height: 90px;
}
}
/*Avatars in the embedded replies will remain the default size,
increase or decrease the size according to your needs*/
.embedded-posts .topic-avatar {
width: 45px;
img.avatar {
width: 45px;
height: 45px;
}
}
But if you use the flair for the primary groups they will be too small now
2. (Optional) Increase size and reposition flairs
Letās increase the flair a little. By default it is 14px, I double the size to 28px.
Depending on the size of the avatars you have chosen, you will have to increase or decrease the size of the flair accordingly.
/*Increase the flair size*/
.topic-avatar .avatar-flair {
font-size: 28px;
width: 30px;
height: 30px;
}
/*Leave the default size on the embedded posts,
increase or decrease the size according to your needs*/
.embedded-posts.bottom .topic-avatar .avatar-flair {
font-size: 14px;
width: 20px;
height: 20px;
}
3. No more blurred avatar.
Add this script under Desktop > Head tab. Remember to change the size (ā90ā) with the size you have chosen
<script>
Discourse._registerPluginCode('0.8', function (api) {
api.changeWidgetSetting('post-avatar', 'size', '90');
});
</script>
I have tried this on a Material Design Theme and the āfont-size:ā field is not changing the flair size no matter the size iām setting. The width and height does change the position of the flair meaning they are working but the font-size not. Any ideas how to solve this?
is there any way to change the avatar size for topics of one category?
I know this can be done via css, but I want the javascript to be also limited for the specific category so that it doesnāt load large images for the unnecessary cases.
CSS doesnāt instruct a browser on what size images to get for the avatars. It instructs a browser on what size to render the images itās served. What you need to be concerned about is not āloading largeā images. But retaining quality when smaller dimension images are displayed larger than they are. (usually enlarging small images larger is a poor idea, but you should be able to get a bit of a tweak by OK)
p.s.: I donāt know how to explain what I mean, and thanks in advance for your patience.
to get a 90px image, for the avatar, as explained above, I should use a script:
now I want this script to work only for a specific category. is it possible to achieve this via js, such taht other categories get 45 px avatar as usual?