From 49524b844eb56d4b11ea085fb2383c426b0c0c1f Mon Sep 17 00:00:00 2001 From: silverwind Date: Fri, 28 Mar 2025 11:25:13 +0100 Subject: [PATCH] Simplify emoji rendering (#34048) It seems like most of our custom styles around the .emoji class are useless and we can just make them render like any other text. Rendering should now match GitHub. Fixes: https://github.com/go-gitea/gitea/issues/34019 Also see https://github.com/go-gitea/gitea/pull/11541 and https://github.com/go-gitea/gitea/pull/12317 for some context. I think browser emoji rendering has improved in recent years so these hacks are no longer needed. --------- Co-authored-by: wxiaoguang --- web_src/css/base.css | 9 +-------- web_src/css/markup/content.css | 5 ----- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/web_src/css/base.css b/web_src/css/base.css index 1a354c96633fe..01eff4ac07029 100644 --- a/web_src/css/base.css +++ b/web_src/css/base.css @@ -1225,14 +1225,7 @@ table th[data-sortt-desc] .svg { box-shadow: 0 0 0 1px var(--color-secondary) inset; } -.emoji { - font-size: 1.25em; - line-height: var(--line-height-default); - font-style: normal !important; - font-weight: var(--font-weight-normal) !important; - vertical-align: -0.075em; -} - +/* for "image" emojis like ":git:" ":gitea:" and ":github:" (see CUSTOM_EMOJIS config option) */ .emoji img { border-width: 0 !important; margin: 0 !important; diff --git a/web_src/css/markup/content.css b/web_src/css/markup/content.css index d2dcf2ec6ec38..4c6940e027784 100644 --- a/web_src/css/markup/content.css +++ b/web_src/css/markup/content.css @@ -337,11 +337,6 @@ padding-right: 28px; } -.markup .emoji { - max-width: none; - vertical-align: text-top; -} - .markup span.frame { display: block; overflow: hidden;