|
23 | 23 | } |
24 | 24 |
|
25 | 25 | .title { |
| 26 | + // Base positioning (always) |
26 | 27 | .ha-wrap.has-selection > .ha-group { |
27 | 28 | position: absolute; |
28 | 29 | right: -3.9rem; |
29 | 30 | top: 50%; |
30 | 31 | transform: translateY(-50%); |
31 | 32 | z-index: 10; |
32 | 33 |
|
| 34 | + // Default: hide chat until “open” state |
33 | 35 | .ha-chat-btn { |
34 | 36 | display: none; |
35 | 37 | } |
36 | 38 | } |
37 | 39 |
|
38 | | - &:hover .ha-wrap.has-selection > .ha-group { |
| 40 | + // “Open” state: |
| 41 | + // - on hover |
| 42 | + // - OR when unread count exists on the group |
| 43 | + &:hover .ha-wrap.has-selection > .ha-group, |
| 44 | + .ha-wrap.has-selection > .ha-group[data-unread-count]:not([data-unread-count='']) { |
39 | 45 | flex-direction: column; |
40 | 46 | align-items: center; |
41 | 47 | background-color: var(--bg-docy, #fff); |
|
46 | 52 | gap: 2px; |
47 | 53 | border-radius: 46%; |
48 | 54 |
|
49 | | - .ha-comment-btn { |
50 | | - border-radius: 0 0 46% 46% !important; |
51 | | - } |
52 | | - .ha-chat-btn { |
53 | | - border-radius: 46% 46% 0 0 !important; |
54 | | - } |
55 | | - |
56 | | - .ha-chat-btn, |
57 | | - .ha-comment-btn { |
| 55 | + // Shared button reset + show buttons |
| 56 | + :is(.ha-chat-btn, .ha-comment-btn) { |
58 | 57 | position: relative !important; |
59 | 58 | transform: none !important; |
60 | 59 | box-shadow: none; |
61 | | - border-radius: 0; |
62 | 60 | border: 0; |
63 | 61 | top: 0 !important; |
64 | 62 | left: 0 !important; |
65 | 63 | right: 0 !important; |
66 | 64 | display: flex; |
67 | 65 | } |
| 66 | + |
| 67 | + // Keep your “capsule” corners |
| 68 | + .ha-chat-btn { |
| 69 | + border-radius: 46% 46% 0 0 !important; |
| 70 | + } |
| 71 | + |
| 72 | + .ha-comment-btn { |
| 73 | + border-radius: 0 0 46% 46% !important; |
| 74 | + } |
68 | 75 | } |
69 | | -} |
70 | 76 |
|
71 | | -.ha-chat-btn, |
72 | | -.ha-comment-btn { |
73 | | - svg { |
74 | | - position: relative; |
75 | | - top: 1px; |
| 77 | + // Unread-only extras (badge + force visibility) |
| 78 | + .ha-wrap.has-selection > .ha-group[data-unread-count]:not([data-unread-count='']) { |
| 79 | + :is(.ha-chat-btn, .ha-comment-btn) { |
| 80 | + display: flex !important; |
| 81 | + visibility: visible !important; |
| 82 | + } |
| 83 | + |
| 84 | + &::before { |
| 85 | + content: attr(data-unread-count); |
| 86 | + position: absolute; |
| 87 | + z-index: 2; |
| 88 | + |
| 89 | + top: 0; |
| 90 | + right: 0; |
| 91 | + left: 23px; |
| 92 | + |
| 93 | + display: flex; |
| 94 | + align-items: center; |
| 95 | + justify-content: center; |
| 96 | + |
| 97 | + color: #fff; |
| 98 | + font-weight: 600; |
| 99 | + font-size: 12px; |
| 100 | + |
| 101 | + background-color: red !important; |
| 102 | + border-radius: var(--radius-field); |
| 103 | + |
| 104 | + width: max-content; |
| 105 | + max-width: 20rem; |
| 106 | + padding-block: 0.25rem; |
| 107 | + padding-inline: 0.5rem; |
| 108 | + |
| 109 | + text-align: center; |
| 110 | + white-space: normal; |
| 111 | + transform: none; |
| 112 | + opacity: 1; |
| 113 | + } |
76 | 114 | } |
77 | 115 | } |
78 | 116 |
|
79 | | -// Unread message count badge |
| 117 | +// Icon nudge (cleaner selector) |
| 118 | +:is(.ha-chat-btn, .ha-comment-btn) svg { |
| 119 | + position: relative; |
| 120 | + top: 1px; |
| 121 | +} |
| 122 | + |
| 123 | +// Unread message count badge on the chat button (separate feature) |
80 | 124 | .ha-chat-btn[data-unread-count]:not([data-unread-count='']) { |
81 | | - // Show count inside button |
| 125 | + visibility: visible !important; |
| 126 | + |
82 | 127 | &::before { |
83 | 128 | content: attr(data-unread-count); |
84 | 129 | color: #fff; |
85 | | - font-weight: semibold; |
| 130 | + font-weight: 600; |
86 | 131 | display: flex; |
87 | 132 | align-items: center; |
88 | 133 | justify-content: center; |
| 134 | + |
89 | 135 | transform: none; |
90 | 136 | opacity: 1; |
91 | 137 | background-color: red !important; |
92 | 138 | font-size: 16px; |
93 | | - top: 0px; |
94 | | - right: 0px; |
| 139 | + |
| 140 | + top: 0; |
| 141 | + right: 0; |
95 | 142 | left: 23px; |
96 | 143 | } |
| 144 | + |
97 | 145 | &::after { |
98 | 146 | display: none; |
99 | 147 | } |
|
0 commit comments