XF 2.2 How to get avatar rounded but not resource icons ?

Nicolas FR

Well-known member
Hello,

Is there a way to avoid this ?
When i put 50px radius in avatar settings, resources avatar are rounded too...

Thanks !
 
Use the extra.less template to set a different radius for avatars on resource pages.

Less:
[data-type="resource"]
{
    .avatar
    {
        border-radius: 10px;
    }
}

You will likely need additional selectors, depending on which elements you want to target.
 
Thanks Brogan,

This code works for .avatar 48x48 but i can't find what code for others sizes.
depending on which elements you want to target.
All sizes i want to target.
I tried .avatar.avatar-m or .avatar-m in the same code for example but without success, any idea ?

i tried this too
CSS:
[data-type="resource"]
{
    .avatar
    {border-radius: 2px;}
    & .avatar--m
    {border-radius: 2px;}
    & .avatar--xxs
    {border-radius: 2px;}
}
 
None of those are covered by [data-type="resource"] which is why I said "You will likely need additional selectors, depending on which elements you want to target.".

Use the browser inspector (F12) to inspect the page to determine what selectors you need to use.

For the carousel for example you can use [data-xf-init="carousel"] which would then make the code:

Less:
[data-type="resource"],
[data-xf-init="carousel"]
{
    .avatar
    {
        border-radius: 10px;
    }
}

Or you could do it based on the template name, instead of data.
 
Top Bottom