Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

inbox, recent_view: Restyle unread-count focus ring.

Aman Agrawal110eb4ad5403
diff --git a/web/styles/inbox.css b/web/styles/inbox.css
index 26da579e0ae..3208a454683 100644
--- a/web/styles/inbox.css
+++ b/web/styles/inbox.css
@@ -827,9 +827,24 @@
}
}
+ /* Outline on the row-tall click wrapper rather than the
+ inner badge, with `-2px` offset so the painted ring sits
+ 2px inside the wrapper edges — matching the action button
+ and state-marker focus rings (also -2px on a 30px wrapper)
+ so all four inbox focus indicators read at the same 26px
+ outer height. */
.unread-count-focus-outline {
&:focus-visible {
- outline: 2px solid var(--color-outline-focus);
+ outline: var(--focus-ring-outline);
+ outline-offset: -0.125em; /* -2px at 16px/1em */
+ border-radius: 0.3125em; /* 5px at 16px/1em */
+
+ /* Suppress the inner badge's `inset` `box-shadow`
+ (from `.normal-count`) so it doesn't read as a
+ second, narrower outline inside the focus ring. */
+ .unread_count {
+ box-shadow: none;
+ }
}
}
diff --git a/web/styles/recent_view.css b/web/styles/recent_view.css
index 311bbb44fe3..16baecda32b 100644
--- a/web/styles/recent_view.css
+++ b/web/styles/recent_view.css
@@ -942,4 +942,30 @@
.recent-view-table-unread-count {
border-radius: 0.3125em; /* 5px at 16px/1em */
+ position: relative;
+}
+
+/* Focus ring drawn as a pseudo-element so the ring's corner
+ radius can be set independently of the badge's, and so the
+ wrapper-level `:focus` outline rule on `.recent_view_focusable`
+ (which the badge also matches) does not stack a second concentric
+ outline on top. Scoped via `#recent_view:not(.no-visible-focus-outlines)`
+ so it stays suppressed alongside the wrapper outline until the
+ first keyboard navigation key removes the class (see
+ focus_outline_util.ts), and so the rule has high enough
+ specificity to beat the wrapper rule. Inset `-5px` matches the
+ breathing room the inbox wrapper-extending outline gets from its
+ `padding: 0 5px`. */
+#recent_view:not(.no-visible-focus-outlines)
+ .recent-view-table-unread-count:focus {
+ outline: none;
+
+ &::before {
+ content: "";
+ position: absolute;
+ inset: -0.3125em; /* -5px at 16px/1em */
+ border: var(--focus-ring-outline);
+ border-radius: 0.3125em; /* 5px at 16px/1em */
+ pointer-events: none;
+ }
}