Skip to content

Fix autofill background mismatch in InputGroup and standalone Input#534

Open
pedromenezes1 wants to merge 6 commits into
cloudflare:mainfrom
pedromenezes1:fix/autofill-background-inputgroup
Open

Fix autofill background mismatch in InputGroup and standalone Input#534
pedromenezes1 wants to merge 6 commits into
cloudflare:mainfrom
pedromenezes1:fix/autofill-background-inputgroup

Conversation

@pedromenezes1

@pedromenezes1 pedromenezes1 commented May 22, 2026

Copy link
Copy Markdown
Collaborator

When browser autofill kicks in, Chrome applies a forced background color only to the <input> element, but not the surrounding InputGroup container or addons. This creates a visual mismatch where the input is blue-tinted but icons, suffixes, and buttons remain white.

Approach

  • Use a box-shadow: inset trick to override Chrome's forced autofill background on all inputs/textareas with a consistent kumo-info-tint at 20% mixed with kumo-control
  • Spread the same tint to the InputGroup container and hybrid zone via :has(input:-webkit-autofill)
  • Preserve Tailwind's ring on standalone inputs by compositing the inset fill alongside all --tw-*-shadow variables
  • Suppress the input border inside InputGroup (container handles it) while keeping it on standalone inputs
  • Delay Chrome's forced background-color via transition: background-color 5000s so the box-shadow tint is visible*

*Chrome's stylesheet forces an autofill background-color that renders on top of box-shadow: inset and cannot be overridden by our styles. The transition: background-color 5000s delays it from ever visually taking effect, which is the standard workaround used across design systems.

Preview
https://62cda41f-kumo-docs.design-engineering.workers.dev/components/input-group/#icon
https://62cda41f-kumo-docs.design-engineering.workers.dev/components/input-group/#button
https://62cda41f-kumo-docs.design-engineering.workers.dev/components/input

Before

10-inputgroup-icon-light-production 11-inputgroup-button-light-closeup

After

01-inputgroup-icon-light-tooltip 02-inputgroup-icon-light-typed 03-inputgroup-button-light-tooltip 04-inputgroup-button-light-typed 05-input-email-light-autocomplete 06-input-email-light-filled 07-input-email-dark-filled 08-inputgroup-icon-dark-typed 09-inputgroup-button-dark-typed
  • Reviews
  • bonk has reviewed the change
  • automated review not possible because: CSS-only change affecting browser autofill behavior, requires manual visual testing across browsers
  • Tests
  • Tests included/updated
  • Additional testing not necessary because: CSS-only visual fix for browser autofill styling, not testable with unit tests

@pkg-pr-new

pkg-pr-new Bot commented May 22, 2026

Copy link
Copy Markdown
npm i https://pkg.pr.new/@cloudflare/kumo@534

commit: ec05ed7

@github-actions

github-actions Bot commented May 22, 2026

Copy link
Copy Markdown
Contributor

Docs Preview

View docs preview

Commit: ec05ed7

@github-actions

github-actions Bot commented May 22, 2026

Copy link
Copy Markdown
Contributor
Visual Regression Report — 11 changed, 30 unchanged

11 screenshot(s) with visual changes:

Button / Loading State

29 px (0.03%) changed

Before After Diff
Before After Diff

Dialog / Dialog With Actions

298 px (0.29%) changed

Before After Diff
Before After Diff

Dialog / Dialog Confirmation

855 px (0.84%) changed

Before After Diff
Before After Diff

Dialog / Dialog With Select

500 px (0.49%) changed

Before After Diff
Before After Diff

Dialog / Dialog With Dropdown

383 px (0.38%) changed

Before After Diff
Before After Diff

Select / Select Sizes

3,134 px (1.68%) changed

Before After Diff
Before After Diff

Select / Select With Description

2,015 px (1.7%) changed

Before After Diff
Before After Diff

Select / Select With Tooltip

1,067 px (1.05%) changed

Before After Diff
Before After Diff

Select / Select Loading

0 px (0%) changed

Before After Diff
Before After Diff

Select / Select Long List

2,050 px (1.73%) changed

Before After Diff
Before After Diff

Select (Open)

541 px (0%) changed

Before After Diff
Before After Diff
30 screenshot(s) unchanged
  • Button / Basic
  • Button / Variant: Primary
  • Button / Variant: Secondary
  • Button / Variant: Ghost
  • Button / Variant: Destructive
  • Button / Variant: Outline
  • Button / Variant: Secondary Destructive
  • Button / Sizes
  • Button / With Icon
  • Button / Icon Only
  • Button / Disabled State
  • Button / Title
  • Button / Link as Button
  • Dialog / Dialog Basic
  • Dialog / Dialog Sizes
  • Dialog / Dialog Alert
  • Dialog / Custom Max Width
  • Dialog / Dialog With Combobox
  • Dialog (Open)
  • Select / Select Basic
  • Select / Select Without Label
  • Select / Select With Error
  • Select / Select Placeholder
  • Select / Select Custom Rendering
  • Select / Select Multiple
  • Select / Select Complex
  • Select / Select Disabled Options
  • Select / Select Disabled Items
  • Select / Select Grouped
  • Select / Select Grouped With Disabled

Generated by Kumo Visual Regression

@pedromenezes1

Copy link
Copy Markdown
Collaborator Author

Safari

Before After
Screenshot 2026-05-22 at 21 12 11 Screenshot 2026-05-22 at 21 11 49

Firefox

Before After
Screenshot 2026-05-22 at 21 13 56 Screenshot 2026-05-22 at 21 14 36

@pedromenezes1

Copy link
Copy Markdown
Collaborator Author

/bonk

@ask-bonk

ask-bonk Bot commented May 22, 2026

Copy link
Copy Markdown
Contributor

PR #534 Summary: Fix Autofill Background Mismatch in InputGroup

Overview

This PR fixes visual inconsistencies when browser autofill is active on inputs, where Chrome's forced blue background only applied to the input element but not surrounding icons, suffixes, or buttons in InputGroup containers.

Changes Made

1. .changeset/autofill-input-group.md (Added)

  • Changeset declaring a patch-level change for @cloudflare/kumo

2. packages/kumo/src/styles/kumo-binding.css (Added 53 lines)

  • Input/textarea autofill styling: Uses a box-shadow: inset trick with 1000px spread to create a consistent background color mixing kumo-info-tint (30%) with kumo-control
  • Tailwind shadow compatibility: Composites all --tw-*-shadow variables to preserve rings and other shadow effects
  • Chrome background-color delay: transition: background-color 5000s prevents Chrome's forced autofill color from visually appearing
  • InputGroup border suppression: Sets border-color: transparent on autofilled inputs inside InputGroup (container handles borders)
  • Container tint spreading: Uses :has(input:-webkit-autofill) selector to apply matching background tint to InputGroup containers and hybrid zones (20% mix)

Key Technical Details

  • Color values: Input uses 30% tint, container uses 20% tint for proper visual layering
  • Browser support: WebKit-based browsers (Chrome, Safari, Edge); Firefox doesn't show autofill styling differences
  • Tailwind integration: Shadow variables ensure ring-* utilities still work on autofilled inputs

Verification Evidence

  • Manual testing: Safari and Firefox screenshots provided showing consistent appearance
  • Visual regression: 9 diffs detected (mostly minor sub-pixel changes on Button, Dialog, Select)
  • Preview links: Available for testing at 11c0000f-kumo-docs.design-engineering.workers.dev

Approvals

  • ✅ Automated review skipped (CSS-only visual fix, requires manual testing)
  • ✅ Tests not needed (visual styling only)
  • ⏳ Awaiting bonk review

The implementation follows the standard browser autofill override pattern used across design systems and properly integrates with the Kumo theme token system.

github run

@pedromenezes1 pedromenezes1 marked this pull request as ready for review May 22, 2026 20:26
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.

2 participants