Reaction emoji are monochrome until hovered or focused

0c6677d · gmorell · 2026-12-03 02:36

5 files +5 -4
Message
{commit_body(@commit)}

Files changed

modified templates/forum/_post.html
+1 −1
@@ -34,7 +34,7 @@
34 34 {% include "forum/_reactions.html" %}
35 35 {% elif post.reactions %}
36 36 <div class="flex flex-wrap items-center gap-1 mt-2">
37 − {% for r in post.reactions %}{% if r.count > 0 %}<span class="badge badge-ghost badge-sm">{{ r.emoji }} {{ r.count }}</span>{% endif %}{% endfor %}
37 + {% for r in post.reactions %}{% if r.count > 0 %}<span class="group/react badge badge-ghost badge-sm"><span class="grayscale opacity-70 transition duration-150 group-hover/react:grayscale-0 group-hover/react:opacity-100">{{ r.emoji }}</span> {{ r.count }}</span>{% endif %}{% endfor %}
38 38 </div>
39 39 {% endif %}
40 40 {% if user %}
modified templates/forum/_reactions.html
+3 −2
@@ -1,8 +1,9 @@
1 1 <div id="reactions-{{ post.id }}" class="flex flex-wrap items-center gap-1 mt-2">
2 2 {% for r in post.reactions %}
3 3 <button hx-post="/p/{{ post.id }}/react/{{ r.key }}" hx-target="#reactions-{{ post.id }}" hx-select="unset" hx-swap="outerHTML"
4 − type="button" class="btn btn-xs {% if r.reacted %}btn-primary{% else %}btn-ghost{% endif %}" title="{{ r.key }}">
5 − <span>{{ r.emoji }}</span>{% if r.count > 0 %}<span class="ml-1 font-mono">{{ r.count }}</span>{% endif %}
4 + type="button" class="group/react btn btn-xs {% if r.reacted %}btn-primary{% else %}btn-ghost{% endif %}" title="{{ r.key }}">
5 + {# Emoji stay monochrome until hovered or focused. #}
6 + <span class="grayscale opacity-70 transition duration-150 group-hover/react:grayscale-0 group-hover/react:opacity-100 group-focus-visible/react:grayscale-0 group-focus-visible/react:opacity-100">{{ r.emoji }}</span>{% if r.count > 0 %}<span class="ml-1 font-mono">{{ r.count }}</span>{% endif %}
6 7 </button>
7 8 {% endfor %}
8 9 </div>
modified templates/forum/_topic_tile.html
+1 −1
@@ -28,7 +28,7 @@
28 28 {% for p in t.posters %}<span class="rounded-full ring-2 ring-base-100 inline-flex">{{ ui.avatar(p.id, p.name, p.has_avatar, "size-6", "text-[0.65rem]") | safe }}</span>{% endfor %}
29 29 </span>
30 30 <span class="flex items-center gap-1 text-xs">
31 − {% for r in t.reactions %}<span class="badge badge-ghost badge-sm">{{ r.emoji }} {{ r.count }}</span>{% endfor %}
31 + {% for r in t.reactions %}<span class="badge badge-ghost badge-sm"><span class="grayscale opacity-70 transition duration-150 group-hover/tile:grayscale-0 group-hover/tile:opacity-100 group-focus-visible/tile:grayscale-0 group-focus-visible/tile:opacity-100">{{ r.emoji }}</span> {{ r.count }}</span>{% endfor %}
32 32 </span>
33 33 </div>
34 34 <div class="flex items-center justify-between text-xs opacity-70 font-mono">

Parents: e763f8f