From c630abb3c56abd451c2968800d49e9245557533a Mon Sep 17 00:00:00 2001 From: ansuz Date: Wed, 25 Aug 2021 12:59:37 +0530 Subject: [PATCH] refactor animal avatar font-size to automatically scale with parents --- customize.dist/src/less2/include/avatar.less | 8 +++++++- customize.dist/src/less2/include/toolbar.less | 3 --- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/customize.dist/src/less2/include/avatar.less b/customize.dist/src/less2/include/avatar.less index 02abc4050..079ceb60d 100644 --- a/customize.dist/src/less2/include/avatar.less +++ b/customize.dist/src/less2/include/avatar.less @@ -40,7 +40,13 @@ color: @cp_avatar-fg; font-size: @avatar-font-size; font-size: var(--avatar-font-size); - text-transform: capitalize; + .animal { + font-size: 20px; + // scale animal avatar to be somewhat larger, because: + // 1. emojis are wider than most latin characters + // 2. they should occupy the width of two average characters + font-size: calc(var(--avatar-width) * (6/5)); + } } media-tag { min-height: @avatar-width; diff --git a/customize.dist/src/less2/include/toolbar.less b/customize.dist/src/less2/include/toolbar.less index d8029f0d2..28b513095 100644 --- a/customize.dist/src/less2/include/toolbar.less +++ b/customize.dist/src/less2/include/toolbar.less @@ -200,9 +200,6 @@ .avatar_main(30px); .cp-avatar-default, media-tag { margin-right: 5px; - &.animal { - font-size: 20px; - } } &.cp-userlist-clickable { cursor: pointer;