Repository navigation
UI: no second focus ring inside text fields - #1
Open
Richards0nd wants to merge 1 commit into
Open
Richards0nd wants to merge 1 commit into
Richards0nd wants to merge 1 commit into
Conversation
The app's global :focus-visible rule was unlayered, so it beat the kit's `outline: none` on the inner <input> of TextField (and the other framed controls: TextArea, Select, Combobox, NumberField). A focused field drew its own frame plus a small ring around the bare input inside it. The rule now lives in @layer ca.base, after the kit's base focus rule: plain elements keep LowMail's ring, kit components keep their own focus styling.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Clicking a text field (e.g. "Seu nome" on the first-run account form) draws the field's focus frame and a second, smaller ring around the bare
<input>inside it.Cause:
src/app.csssets a global:focus-visible { outline: … }outside any cascade layer.@codeatlasdev/uiputs component styles in@layer ca.components, and unlayered CSS always wins over layered CSS, so the kit's.ca-tf__input { outline: none }was overridden. The same applies to every kit control that draws focus on its wrapper (TextArea, Select, Combobox, NumberField…).Fix
Move the global focus rule into
@layer ca.base, after the kit's own base focus rule:--lm-signal, 2px, inset);Side effect: kit buttons now use the kit's
--ca-focus-ringinstead of--lm-signal. On the dark theme it is a slightly lighter lime; on the light theme a darker green, with better contrast on light backgrounds.Verification
Chromium, dev build, focused input on the account form:
<input>outlinesolid 2pxnoneTab through the form: reveal button, submit button and links still show a 2px focus ring.
bun run check(0 errors),bun run lint:ui(clean),bun run buildpass.Full sweep (demo webmail, signed in as alice)
Every visible focusable element on each screen was focused and its outline compared with the old unlayered rule re-injected vs. the fix. Screens: mail list, open message, compose, contacts, every Settings section (General, Reading, Composing, Identities, Folders, Filters, Vacation reply, About), new filter rule, Account dialog, New folder dialog, Search filters popover.
Controls that had the doubled ring and are fixed (inner outline gone, the kit frame shows focus):
TextField(.ca-tf__input)TextArea(.ca-ta__input)NumberField(.ca-nf__input)Selecttrigger (.ca-sel__trigger)After the focus transition, each frame has the focus border plus a 2px ring.
Only other change: kit buttons (
ca-btn,ca-icon-btn,ca-seg__item,ca-layer-close) still get a 2px solid focus ring, now in--ca-focus-ringcolor instead of--lm-signal. LowMail's own controls (folder tree, message rows, search box, rail) are unchanged: 0 differences.