diff --git a/packages/app/src/session/timeline/search-bar.css b/packages/app/src/session/timeline/search-bar.css index c76429fd2e0..629e3c78f0f 100644 --- a/packages/app/src/session/timeline/search-bar.css +++ b/packages/app/src/session/timeline/search-bar.css @@ -1,7 +1,13 @@ [data-component="timeline-search-bar"] [data-component="text-input-v2"] { background: var(--v2-background-bg-base); box-shadow: inset 0 0 0 1px var(--v2-border-border-base); - outline: none; +} + +/* The focus state here is an inset shadow, which forced colours remove, so leave the field's own ring alone there. */ +@media (forced-colors: none) { + [data-component="timeline-search-bar"] [data-component="text-input-v2"] { + outline: none; + } } [data-component="timeline-search-bar"] [data-component="text-input-v2"]:hover { @@ -10,5 +16,4 @@ [data-component="timeline-search-bar"] [data-component="text-input-v2"]:focus-within { box-shadow: inset 0 0 0 1px var(--v2-border-border-focus); - outline: none; } diff --git a/packages/app/src/shell/palette-menu.css b/packages/app/src/shell/palette-menu.css index e48f7c0f8d5..ab9d28e7025 100644 --- a/packages/app/src/shell/palette-menu.css +++ b/packages/app/src/shell/palette-menu.css @@ -8,7 +8,6 @@ height: 36px; padding-inline-end: 12px; border-radius: 6px; - outline: 0; background: color-mix(in srgb, var(--v2-background-bg-layer-02) 60%, transparent); box-shadow: none; transition: @@ -22,6 +21,12 @@ box-shadow: none; } +@media (forced-colors: none) { + .palette-menu-search [data-component="text-input-v2"] { + outline: 0; + } +} + .palette-menu-search [data-slot="text-input-v2-value"] { border-radius: 6px; background: transparent; diff --git a/packages/app/src/shell/search-list.css b/packages/app/src/shell/search-list.css index a211a60cf1a..239a105a0df 100644 --- a/packages/app/src/shell/search-list.css +++ b/packages/app/src/shell/search-list.css @@ -340,11 +340,17 @@ [data-component="text-input-v2"], [data-component="text-input-v2"]:where(:hover, :focus-within):not([data-disabled], [data-invalid]) { border-radius: 0; - outline: 0; background: transparent; box-shadow: none; } + @media (forced-colors: none) { + [data-component="text-input-v2"], + [data-component="text-input-v2"]:where(:hover, :focus-within):not([data-disabled], [data-invalid]) { + outline: 0; + } + } + [data-slot="text-input-v2-value"] { gap: 8px; } diff --git a/packages/session-ui/src/components/line-comment-styles.ts b/packages/session-ui/src/components/line-comment-styles.ts index 7a3eff77277..f4683b51cc0 100644 --- a/packages/session-ui/src/components/line-comment-styles.ts +++ b/packages/session-ui/src/components/line-comment-styles.ts @@ -169,9 +169,11 @@ export const lineCommentStyles = ` line-height: var(--line-height-large); } +/* An outline, not a shadow: forced colours drop shadows, and the outline outside the border still marks focus there. */ [data-component="line-comment"] [data-slot="line-comment-textarea"]:focus { - outline: none; - box-shadow: var(--shadow-xs-border-select); + border-color: var(--v2-border-border-focus); + outline: 1px solid var(--v2-border-border-focus); + outline-offset: 0; } [data-component="line-comment"] [data-slot="line-comment-mention-list"] { diff --git a/packages/ui/src/forms/search-list/search-list.css b/packages/ui/src/forms/search-list/search-list.css index 6b0e92c45e9..376a7147267 100644 --- a/packages/ui/src/forms/search-list/search-list.css +++ b/packages/ui/src/forms/search-list/search-list.css @@ -16,7 +16,6 @@ height: 36px; padding-inline-end: 12px; border-radius: 6px; - outline: 0; background: color-mix(in srgb, var(--v2-background-bg-layer-02) 60%, transparent); box-shadow: none; transition: @@ -29,6 +28,12 @@ box-shadow: none; } + @media (forced-colors: none) { + [data-component="text-input-v2"] { + outline: 0; + } + } + [data-slot="text-input-v2-value"] { gap: 8px; border-radius: 6px; diff --git a/packages/ui/src/forms/text-input/text-input.css b/packages/ui/src/forms/text-input/text-input.css index bf5bd7a836b..82de0d98767 100644 --- a/packages/ui/src/forms/text-input/text-input.css +++ b/packages/ui/src/forms/text-input/text-input.css @@ -22,7 +22,6 @@ align-self: stretch; transition: background 85ms ease-out, - outline-color 85ms ease-out, box-shadow 85ms ease-out; } @@ -206,4 +205,25 @@ color: var(--v2-state-fg-danger); opacity: 1; } + + /* + Forced colours remove the shadow that draws the field's edge and turn every outline the same system colour, so rest, + focus and invalid looked identical. The edge becomes a border (dashed when invalid) and focus gets the shared ring. + */ + @media (forced-colors: active) { + [data-component="text-input-v2"] { + border: 1px solid CanvasText; + outline: none; + } + + [data-component="text-input-v2"]:where([data-invalid]):not([data-disabled]) { + border: 2px dashed CanvasText; + outline: none; + } + + [data-component="text-input-v2"]:focus-within:not([data-disabled]) { + outline: 2px solid Highlight; + outline-offset: 2px; + } + } } diff --git a/packages/ui/src/forms/textarea/textarea.css b/packages/ui/src/forms/textarea/textarea.css index b72dacee6e4..aab24d0a677 100644 --- a/packages/ui/src/forms/textarea/textarea.css +++ b/packages/ui/src/forms/textarea/textarea.css @@ -16,7 +16,6 @@ align-self: stretch; transition: background 85ms ease-out, - outline-color 85ms ease-out, box-shadow 85ms ease-out; } @@ -81,3 +80,24 @@ color: var(--v2-state-fg-danger); opacity: 1; } + +/* + Forced colours remove the shadow that draws the field's edge and turn every outline the same system colour, so rest, + focus and invalid looked identical. The edge becomes a border (dashed when invalid) and focus gets the shared ring. +*/ +@media (forced-colors: active) { + [data-component="textarea-v2"] { + border: 1px solid CanvasText; + outline: none; + } + + [data-component="textarea-v2"]:where([data-invalid]):not([data-disabled]) { + border: 2px dashed CanvasText; + outline: none; + } + + [data-component="textarea-v2"]:focus-within:not([data-disabled]) { + outline: 2px solid Highlight; + outline-offset: 2px; + } +}