Skip to content

UI: no second focus ring inside text fields - #1

Open
Richards0nd wants to merge 1 commit into
mainfrom
fix/focus-ring-inside-fields
Open

Richards0nd wants to merge 1 commit into
mainfrom
fix/focus-ring-inside-fields

Conversation

@Richards0nd

@Richards0nd Richards0nd commented Oct 30, 2026 •

Copy link
Copy Markdown

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.css sets a global :focus-visible { outline: … } outside any cascade layer. @codeatlasdev/ui puts 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:

  • plain elements keep LowMail's ring (--lm-signal, 2px, inset);
  • kit components keep their designed focus styling, so inner inputs no longer get a ring.

Side effect: kit buttons now use the kit's --ca-focus-ring instead 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:

before after
inner <input> outline solid 2px none
field frame focus color focus color

Tab 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 build pass.

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):

control where
TextField (.ca-tf__input) account form, New folder, Vacation reply, filter rule
TextArea (.ca-ta__input) Vacation reply message
NumberField (.ca-nf__input) Vacation reply days
Select trigger (.ca-sel__trigger) Settings › General/Reading/Composing, Search filters, filter rule

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-ring color instead of --lm-signal. LowMail's own controls (folder tree, message rows, search box, rail) are unchanged: 0 differences.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant