Skip to content

Fix autofill background mismatch in InputGroup and standalone Input#534

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

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

Conversation

@pedromenezes1
Copy link
Copy Markdown
Collaborator

@pedromenezes1 pedromenezes1 commented May 22, 2026

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
Copy link
Copy Markdown

pkg-pr-new Bot commented May 22, 2026

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

commit: 24b534c

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 22, 2026

Docs Preview

View docs preview

Commit: 24b534c

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 22, 2026

Visual Regression Report — 20 changed, 19 unchanged

20 screenshot(s) with visual changes:

Button / Basic

183 px (0.18%) changed

Before After Diff
Before After Diff

Button / Loading State

0 px (0%) changed

Before After Diff
Before After Diff

Button / Disabled State

117 px (0.12%) changed

Before After Diff
Before After Diff

Button / Title

272 px (0.27%) changed

Before After Diff
Before After Diff

Dialog / Dialog Basic

114 px (0.11%) changed

Before After Diff
Before After Diff

Dialog / Dialog Alert

354 px (0.35%) changed

Before After Diff
Before After Diff

Dialog (Open)

0 px (0%) changed

Before After Diff
Before After Diff

Select / Select Basic

485 px (0.48%) changed

Before After Diff
Before After Diff

Select / Select Sizes

886 px (0.48%) changed

Before After Diff
Before After Diff

Select / Select Without Label

105 px (0.1%) changed

Before After Diff
Before After Diff

Select / Select With Description

889 px (0.75%) changed

Before After Diff
Before After Diff

Select / Select With Error

1,730 px (1.46%) changed

Before After Diff
Before After Diff

Select / Select Placeholder

595 px (0.59%) changed

Before After Diff
Before After Diff

Select / Select With Tooltip

294 px (0.29%) changed

Before After Diff
Before After Diff

Select / Select Custom Rendering

414 px (0.41%) changed

Before After Diff
Before After Diff

Select / Select Loading

0 px (0%) changed

Before After Diff
Before After Diff

Select / Select Complex

1,090 px (0.92%) changed

Before After Diff
Before After Diff

Select / Select Disabled Options

765 px (0.75%) changed

Before After Diff
Before After Diff

Select / Select Disabled Items

176 px (0.17%) changed

Before After Diff
Before After Diff

Select (Open)

541 px (0%) changed

Before After Diff
Before After Diff
19 screenshot(s) unchanged
  • 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 / Link as Button
  • Dialog / Dialog With Actions
  • Dialog / Dialog Confirmation
  • Dialog / Dialog With Select
  • Dialog / Dialog With Combobox
  • Dialog / Dialog With Dropdown
  • Select / Select Multiple
  • Select / Select Grouped
  • Select / Select Grouped With Disabled
  • Select / Select Long List

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
Copy link
Copy Markdown
Contributor

ask-bonk Bot commented May 22, 2026

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