Skip to content

fix(item): stop ios lines from disappearing - #31800

Draft
thetaPC wants to merge 10 commits into
FW-6848from
FW-7047
Draft

thetaPC wants to merge 10 commits into
FW-6848from
FW-7047

Conversation

@thetaPC

@thetaPC thetaPC commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Issue number: resolves #30772


What is the current behavior?

On iOS, WebKit skips borders thinner than one CSS pixel at some positions on the page, so the 0.55px line between items disappears while scrolling.

What is the new behavior?

  • Adds a hairline mixin that draws a line as a filled box along a top or bottom edge instead of a border. Without a thickness, it is one screen pixel thick at 1x, 2x and 3x.
  • Adds a mediaQuery recipe key: values under mediaQuery.min.resolution set the same variable inside a media query. A value a custom theme sets replaces the base theme's media query values for that key, so it applies on every screen.
  • ion-divider draws its line with the mixin, and the ios theme sets it to one screen pixel at each density.
  • ios ion-item draws its full and inset lines with the mixin, as the line and inner-line parts. Lines sit on the item's bottom edge instead of below it.
  • The ios accordion draws the line above a header that follows an expanded accordion. It uses the shade of the header item's color when it has one.
  • Adds an item hairlines test page that reproduces the missing lines.

Does this introduce a breaking change?

  • Yes
  • No

In the ios theme:

  • --border-width and --inner-border-width no longer draw the lines between items. Use lines="none" to hide a line, or style it with ion-item::part(line) (full width) or ion-item::part(inner-line) (inset). --border-color still sets the line color.
  • Lines no longer add to the item's height, so an item with a line is slightly shorter: half a pixel on most iOS devices.
  • --border-color on an accordion's header item no longer changes the line above it.

Other information

Known gaps

  • If an app merges its own values into the ios tokens instead of using Ionic's theme config, the ios 2x and 3x thickness values still apply, so a custom thickness only shows on 1x screens.
  • Other components with 0.55px borders (header, footer, tab bar, alert, datetime, form controls, split pane) move to the mixin in their own migrations.

How to test

Lines draw one screen pixel thick, with none missing, in Safari on the iOS 17.5 and 26.2 simulators at every position the hairlines page reaches.

Lines look lighter than before in desktop browsers and in Chrome's device toolbar. Those drew the old 0.55px border two screen pixels thick, and the new line is one screen pixel, which is what iPhones always drew.

Check Before After What to look for
Missing lines Copy the hairlines page to core/src/components/item/test/hairlines/index.html on next and run npm start Hairlines Open in Safari on an iPhone or the iOS simulator. Tap Shift a few times. Before, some lines disappear. After, every line stays visible.
Item lines Lines Lines Full, inset and no lines match each label. Colored items draw a darker shade of their color.
Content over a line Basic Basic The PIN item's red line stops at "Must enter 7 digits".
Accordion Basic Basic A line separates Mini Golf from Dining, dark yellow in the colored groups. Expand Exercise: no line above it.

Recipe values under mediaQuery.min.resolution set the same variable inside a media query. A value a custom theme sets replaces the base theme's media query values for that key, so it applies on every screen.
The line is a filled box instead of a border, since WebKit skips borders thinner than one CSS pixel at some positions. The ios theme sets the thickness per screen density.
@thetaPC
thetaPC added this pull request to stack #31795 November 20, 2026 19:15
@vercel

vercel Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
ionic-framework Ready Ready Preview Nov 24, 2026 12:06am UTC

Request Review

# Conflicts:
#	core/src/components/chip/test/basic/chip.e2e.ts-snapshots/chip-descender-ios-ltr-Mobile-Chrome-linux.png
#	core/src/components/chip/test/basic/chip.e2e.ts-snapshots/chip-descender-ios-ltr-Mobile-Firefox-linux.png
#	core/src/components/chip/test/basic/chip.e2e.ts-snapshots/chip-descender-ios-ltr-Mobile-Safari-linux.png

This branch was successfully deployed

1 active deployment
Preview — 6d5be07a Deployed Nov 24, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

package: core @ionic/core package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants