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: Match recent-view row focus outline style.

Alya Abbott131299bc837e
diff --git a/web/styles/app_variables.css b/web/styles/app_variables.css
index b8758a0157e..3caa82a815e 100644
--- a/web/styles/app_variables.css
+++ b/web/styles/app_variables.css
@@ -1014,6 +1014,14 @@
color change touches one place. */
--focus-ring-outline: var(--focus-ring-width-in-views) solid
var(--color-outline-focus);
+ /* Negative-offset paired with `--focus-ring-outline` to pull
+ the painted ring inside the element by its own stroke
+ width, so the ring sits flush with the element edges (used
+ by inbox row outlines that would otherwise clip against the
+ row's `overflow: hidden`). */
+ --focus-ring-outline-offset-in-views: calc(
+ -1 * var(--focus-ring-width-in-views)
+ );
--color-background-search: light-dark(hsl(0deg 0% 100%), hsl(0deg 0% 17%));
--color-background-search-collapsed: light-dark(
hsl(0deg 0% 100%),
diff --git a/web/styles/inbox.css b/web/styles/inbox.css
index b41a905e5de..1bb0a32f4cd 100644
--- a/web/styles/inbox.css
+++ b/web/styles/inbox.css
@@ -77,8 +77,12 @@
.inbox-focus-border {
display: flex;
min-height: 1.875em; /* 30px at 16px em */
- border: 2px solid transparent;
- border-radius: 3px;
+ /* Holds the horizontal layout that the removed
+ `border: 2px solid transparent` was reserving;
+ `.inbox-row`'s outline-based focus doesn't reserve
+ space. Vertical padding omitted so the 30px icon
+ wrappers fit in the 30px row height. */
+ padding-inline: 0.125em; /* 2px at 16px/1em */
box-sizing: border-box;
justify-content: space-between;
}
@@ -292,15 +296,6 @@
width: 80%;
}
- #inbox-direct-messages-container {
- /* Since a direct message row can have span to multiple lines,
- having an underline focus will not work very well.
- */
- .inbox-row:focus-visible {
- box-shadow: inset 0 0 0 2px var(--color-outline-focus);
- }
- }
-
.inbox-left-part {
width: 100%;
display: grid;
@@ -743,9 +738,14 @@
.inbox-header {
&:focus-visible {
- .inbox-focus-border {
- border-color: var(--color-outline-focus);
- }
+ /* Flush outline on the row itself instead of the old
+ 2px inner-border on `.inbox-focus-border`; matches
+ `.recent-view-body-row`'s focus style, but inbox rows
+ are tighter (30px) so the outline sits at the row
+ edges instead of insetting 4px. */
+ outline: var(--focus-ring-outline);
+ outline-offset: var(--focus-ring-outline-offset-in-views);
+ border-radius: 0.625em; /* 10px at 16px/1em */
.collapsible-button > .zulip-icon {
opacity: 1;
@@ -759,13 +759,9 @@
.inbox-row {
&:focus-visible {
- .inbox-focus-border {
- border: 2px solid var(--color-outline-focus);
- border-radius: 3px;
- }
-
- outline: 0;
- padding: 0;
+ outline: var(--focus-ring-outline);
+ outline-offset: var(--focus-ring-outline-offset-in-views);
+ border-radius: 0.625em; /* 10px at 16px/1em */
}
}