Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
3948bdb
feat(themes): add mediaQuery recipe key
thetaPC Nov 20, 2026
f5a3ca4
fix(divider): draw the ios line one screen pixel thick
thetaPC Nov 20, 2026
ae9c5d9
test(item): add hairlines page
thetaPC Nov 20, 2026
f44de72
Merge remote-tracking branch 'origin/FW-6848' into FW-7047
thetaPC Nov 20, 2026
a381b1d
fix(divider): draw the line with a shared hairline mixin
thetaPC Nov 23, 2026
205dc7c
fix(item): draw ios lines one screen pixel thick
thetaPC Nov 23, 2026
5fb4122
chore(): add updated snapshots
Ionitron Nov 23, 2026
d2db954
test(item): remove the tab bar from the hairlines page
thetaPC Nov 23, 2026
4e4cd27
Merge branch 'FW-6848' into FW-7047
thetaPC Nov 23, 2026
6d5be07
fix(themes): keep hairlines in screenshots drawn at 1x
thetaPC Nov 24, 2026
1a0d695
chore(): add updated snapshots
Ionitron Nov 24, 2026
d2302da
fix(item): draw md and ionic lines with the hairline mixin
thetaPC Nov 24, 2026
aa050a0
test(item): keep ios lines in Safari screenshots
thetaPC Nov 24, 2026
3da477c
chore(): add updated snapshots
Ionitron Nov 24, 2026
1344a42
Merge remote-tracking branch 'origin/FW-7047-device-scale-factor' int…
thetaPC Nov 24, 2026
6750f48
chore(): remove snapshots
thetaPC Nov 24, 2026
5de681c
refactor(themes): remove the screenshot offset from the hairline mixin
thetaPC Nov 24, 2026
68c66be
test(item): replace the Safari hairline helper with the ios 1x fixture
thetaPC Nov 24, 2026
6aa3f0c
chore(): run lint
thetaPC Nov 24, 2026
048b37c
Merge remote-tracking branch 'origin/FW-7047-device-scale-factor' int…
thetaPC Nov 24, 2026
038b136
chore(): add updated snapshots
Ionitron Nov 24, 2026
3fe0b62
test(item): keep device resolution lines off the colored item
thetaPC Nov 24, 2026
dee6940
chore(): add updated snapshots
thetaPC Nov 24, 2026
9d8d03e
fix(accordion): hide the expanded header line without changing lines
thetaPC Nov 25, 2026
9f1826f
fix(accordion): update the line above the header when the header item…
thetaPC Nov 25, 2026
415ba6c
fix(item): draw the lines above the state overlay
thetaPC Nov 25, 2026
f2a42b7
docs(item): explain what the border variables do now that lines are e…
thetaPC Nov 25, 2026
25d5d56
docs(themes): scope the media query override to the custom theme's mo…
thetaPC Nov 25, 2026
afb4309
docs(themes): say the last matching media query key wins
thetaPC Nov 25, 2026
fde55ee
test(item): reword the hairlines page params comment
thetaPC Nov 25, 2026
e1ce4a4
chore(accordion): note the old color token to remove in the migration
thetaPC Nov 25, 2026
9eba50d
chore(): add updated snapshots
Ionitron Nov 25, 2026
c861636
Merge remote-tracking branch 'origin/FW-7047-device-scale-factor' int…
thetaPC Dec 2, 2026
05056a8
Merge remote-tracking branch 'origin/FW-7047-device-scale-factor' int…
thetaPC Dec 3, 2026
f198720
chore(): add updated snapshots
Ionitron Dec 3, 2026
a37838d
docs(item): show how to thicken a line
thetaPC Dec 4, 2026
cebbd00
fix(accordion): only draw the top line above an item header
thetaPC Dec 4, 2026
fb94efb
refactor(accordion): build the line color with ionColor
thetaPC Dec 4, 2026
47243d5
refactor(themes): reuse isPlainObject for media query tokens
thetaPC Dec 4, 2026
95d1baf
chore(themes): say why lines are drawn as filled boxes
thetaPC Dec 4, 2026
b6d88ff
chore(scripts): remove the unused deepMerge from the test page script
thetaPC Dec 4, 2026
3c0a98b
fix(item): keep the space below the lines that the border took
thetaPC Dec 4, 2026
8f33da3
chore(): add updated snapshots
Ionitron Dec 5, 2026
4df7fa8
test(item): keep the line space on the alignment and divider spec pages
thetaPC Dec 5, 2026
559d58e
docs(item): say to set lines to show a line
thetaPC Dec 5, 2026
d8cf25e
chore(): add updated snapshots
Ionitron Dec 5, 2026
d220ec3
test(item): restore snapshots whose pixels did not change
thetaPC Dec 5, 2026
29b5ddc
test(tab-button): restore the badge snapshot from the base
thetaPC Dec 5, 2026
caa809d
Merge remote-tracking branch 'origin/FW-7047-device-scale-factor' int…
thetaPC Dec 5, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
21 changes: 21 additions & 0 deletions BREAKING.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ This is a comprehensive list of the breaking changes introduced in the major ver
- [Browser and Platform Support](#version-10x-browser-platform-support)
- [Global Styles](#version-10x-global-styles)
- [Components](#version-10x-components)
- [Accordion](#version-10x-accordion)
- [Backdrop](#version-10x-backdrop)
- [Button](#version-10x-button)
- [Card](#version-10x-card)
Expand All @@ -29,6 +30,7 @@ This is a comprehensive list of the breaking changes introduced in the major ver
- [Grid](#version-10x-grid)
- [Image](#version-10x-image)
- [Input Otp](#version-10x-input-otp)
- [Item](#version-10x-item)
- [Item Divider](#version-10x-item-divider)
- [Label](#version-10x-label)
- [Menu Toggle](#version-10x-menu-toggle)
Expand Down Expand Up @@ -77,6 +79,10 @@ This section details the desktop browser and mobile platform versions that are s

<h2 id="version-10x-components">Components</h2>

<h4 id="version-10x-accordion">Accordion</h4>

- In the ios theme, the line above the header of an accordion that follows an expanded one is drawn by the accordion instead of a border on the header item. It uses `--ion-item-border-color`, or `--ion-border-color` when that isn't set, and the shade of the header item's `color` when it has one. `--border-color` on the header item no longer changes its color.

<h4 id="version-10x-backdrop">Backdrop</h4>

The following breaking changes apply to `ion-backdrop`:
Expand Down Expand Up @@ -652,6 +658,21 @@ Converted `ion-input-otp` to use [Shadow DOM](https://developer.mozilla.org/en-U

If you were targeting the internals of `ion-input-otp` in your CSS, you will need to target the `group`, `container`, `native`, `separator` or `description` [Shadow Parts](https://ionicframework.com/docs/theming/css-shadow-parts) instead, or use the provided CSS Variables.

<h4 id="version-10x-item">Item</h4>

The lines between items are drawn with an element instead of a border, so `--border-width` and `--inner-border-width` no longer show, hide or resize them, and `--border-style` no longer changes their style. `--border-color` still sets their color.

`--border-width` and `--inner-border-width` still draw a border on the item, so an app that set them to thicken a line now gets that border on top of the line. Remove those overrides and style the `line` (full width) or `inner-line` (inset) [Shadow Part](https://ionicframework.com/docs/theming/css-shadow-parts) instead. The line fills only its default thickness, so set `background` along with `height` to thicken it. The item keeps space for the default thickness only, so a thicker line covers the bottom of the item's content.

```css
ion-item::part(line) {
height: 2px;
background: currentColor;
}
```

To hide a line, set `lines="none"` on the item or the list. Hiding the part with `display: none` keeps the space below the line. To show a line, set `lines="full"` or `lines="inset"`, since showing the part with `display: block` leaves out that space.

<h4 id="version-10x-item-divider">Item Divider</h4>

- Component CSS variables have been removed. The component now utilizes the centralized Ionic Theming system. Global updates should be managed via the theme tokens file, while component-specific overrides are handled through localized CSS variables.
Expand Down
2 changes: 2 additions & 0 deletions core/api.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1839,6 +1839,8 @@ ion-item,css-prop,--transition,md
ion-item,part,container
ion-item,part,detail-icon
ion-item,part,inner
ion-item,part,inner-line
ion-item,part,line
ion-item,part,native

ion-item-divider,shadow
Expand Down
35 changes: 10 additions & 25 deletions core/scripts/testing/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,11 @@ const DEFAULT_PALETTE = 'light';
// Store existing theme set from the app initialization
const customTheme = window.Ionic?.config?.customTheme;
// Load the default tokens for the theme
const themeLoaded = import(`/themes/${themeName}/default.tokens.js`).then((defaultTokens) =>
buildTheme(defaultTokens.defaultTheme, customTheme, paletteName)
const themeLoaded = Promise.all([
import(`/themes/${themeName}/default.tokens.js`),
import('/themes/utils/theme.js'),
]).then(([defaultTokens, themeUtils]) =>
buildTheme(defaultTokens.defaultTheme, customTheme, paletteName, themeUtils)
);

/*
Expand Down Expand Up @@ -184,26 +187,6 @@ const DEFAULT_PALETTE = 'light';
window.__ionicTestThemeReady = true;
}

/**
* Deep merges two objects, with source properties overriding target properties
* @param target The target object to merge into
* @param source The source object to merge from
* @returns The merged object
*/
// TODO(FW-6750): Remove this once the theme tokens can be imported directly into the test pages
const deepMerge = (target, source) => {
const result = { ...target };

for (const key in source) {
if (source[key] && typeof source[key] === 'object' && !Array.isArray(source[key])) {
result[key] = deepMerge(result[key] ?? {}, source[key]);
} else {
result[key] = source[key];
}
}
return result;
};

/*
* Resolves once the Ionic Config instance (created by `initialize()` in
* ionic-global.ts) is available. If the app has already loaded we resolve
Expand All @@ -224,11 +207,13 @@ const DEFAULT_PALETTE = 'light';
}

// TODO(FW-6750): Determine if this function can be removed once the theme tokens can be imported directly into the test pages
function buildTheme(tokensTheme, customTheme, paletteName) {
function buildTheme(tokensTheme, customTheme, paletteName, themeUtils) {
let theme = tokensTheme;
// Merge with existing theme to preserve any customizations
// Merge with existing theme to preserve any customizations. A custom
// value replaces the theme's media query values for the same key, as
// it does in the app (refer to `mergeTheme`).
if (customTheme) {
theme = deepMerge(theme, customTheme);
theme = themeUtils.mergeTheme(theme, customTheme);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was the only call to the deepMerge defined at line 197, which is scoped inside the IIFE, so nothing else can reach it now. Can that function be removed along with its TODO?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in b6d88ff.

}

// If a specific palette is requested, modify the palette structure
Expand Down
6 changes: 3 additions & 3 deletions core/src/components/accordion/accordion.common.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
z-index: 0;
}

:host(.accordion-expanding) ::slotted(ion-item[slot="header"]),
:host(.accordion-expanded) ::slotted(ion-item[slot="header"]) {
--border-width: 0px;
// Hidden unless the theme's stylesheet shows it
.accordion-next-line {
display: none;
}

#content {
Expand Down
6 changes: 2 additions & 4 deletions core/src/components/accordion/accordion.ionic.scss
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,11 @@
// Accordion Header
// --------------------------------------------------

// The border is removed from the item in the header because
// we are adding a border to the ::after element of the accordion.
// The header item's lines are hidden in core.ionic.scss because the
// accordion draws its own line with the ::after element.
::slotted(ion-item[slot="header"]) {
--border-radius: inherit;
--color: #{globals.$ion-text-default};
--border-width: #{globals.$ion-border-size-0};
--inner-border-width: #{globals.$ion-scale-0};
--min-height: #{globals.$ion-scale-700};
--padding-top: #{globals.$ion-space-300};
--padding-end: #{globals.$ion-space-400};
Expand Down
20 changes: 18 additions & 2 deletions core/src/components/accordion/accordion.ios.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,22 @@
// iOS Accordion
// --------------------------------------------------

:host(.accordion-next) ::slotted(ion-item[slot="header"]) {
--border-width: #{$item-ios-border-bottom-width 0px $item-ios-border-bottom-width 0px};
// Drawn as a filled box so it stays visible at sub-pixel positions in WebKit
.accordion-next-line {
@include hairline(top);

color: $item-ios-border-bottom-color;

// Above the header item's background
z-index: 1;
}

// The last accordion's header has no lines (refer to core.scss), so it has no top line either
:host(.accordion-next.accordion-has-header-item:not(.accordion-last)) .accordion-next-line {
display: block;
}

// Keeps the space a border took, so the header item doesn't sit under the line
:host(.accordion-next.accordion-has-header-item:not(.accordion-last)) #header {
@include hairline-thickness(padding-top);
}
59 changes: 57 additions & 2 deletions core/src/components/accordion/accordion.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { ComponentInterface } from '@stencil/core';
import { Component, Element, Host, Prop, State, Watch, h } from '@stencil/core';
import { Build, Component, Element, Host, Prop, State, Watch, h } from '@stencil/core';
import { addEventListener, getElementRoot, raf, removeEventListener, transitionEndAsync } from '@utils/helpers';
import { hostContext } from '@utils/theme';
import { hostContext, ionColor } from '@utils/theme';
import { chevronDown } from 'ionicons/icons';

import { config } from '../../global/config';
Expand Down Expand Up @@ -78,6 +78,8 @@ export class Accordion implements ComponentInterface {
private contentEl: HTMLDivElement | undefined;
private contentElWrapper: HTMLDivElement | undefined;
private headerEl: HTMLDivElement | undefined;
private nextLineEl: HTMLDivElement | undefined;
private headerItemColorObserver?: MutationObserver;

private currentRaf: number | undefined;

Expand All @@ -87,6 +89,11 @@ export class Accordion implements ComponentInterface {
@State() isNext = false;
@State() isPrevious = false;
@State() isLast = false;
/**
* Whether an `ion-item` is slotted as the header. Only an item header has
* lines, so the top line is only drawn for one.
*/
@State() hasHeaderItem = false;
/**
* Tracks whether a user-initiated interaction has occurred.
* Animations are disabled until the first interaction happens.
Expand Down Expand Up @@ -147,18 +154,28 @@ export class Accordion implements ComponentInterface {
this.updateState();
addEventListener(accordionGroupEl, 'ionValueChange', this.accordionGroupUpdateHandler);
}

// The header only exists after the first render, so this only runs here
// when the accordion is moved
this.watchHeaderItemColor();
}

disconnectedCallback() {
const accordionGroupEl = this.accordionGroupEl;
if (accordionGroupEl) {
removeEventListener(accordionGroupEl, 'ionValueChange', this.accordionGroupUpdateHandler);
}

this.headerItemColorObserver?.disconnect();
this.headerItemColorObserver = undefined;
}

componentDidLoad() {
this.setItemDefaults();
this.slotToggleIcon();
this.hasHeaderItem = this.getSlottedHeaderIonItem() !== undefined;
this.updateNextLineColor();
this.watchHeaderItemColor();

/**
* We need to wait a tick because we
Expand Down Expand Up @@ -201,6 +218,41 @@ export class Accordion implements ComponentInterface {
}
};

/**
* Colors the top line with the shade of the header item's color, matching
* the item's own lines. The accordion's styles can't read the item's color,
* so the shade is set here.
*/
private updateNextLineColor = () => {
const { nextLineEl } = this;
if (!nextLineEl) {
return;
}

const color = this.getSlottedHeaderIonItem()?.color;
if (color === undefined) {
nextLineEl.style.removeProperty('color');
return;
}

nextLineEl.style.color = ionColor(color, 'shade');
};

/**
* Recolors the top line when the header item's `color` changes. The line is
* drawn by the accordion, so it doesn't follow the item's color on its own.
*/
private watchHeaderItemColor = () => {
const ionItem = this.getSlottedHeaderIonItem();
if (!ionItem || !Build.isBrowser || typeof MutationObserver === 'undefined') {
return;
}

this.headerItemColorObserver?.disconnect();
this.headerItemColorObserver = new MutationObserver(() => this.updateNextLineColor());
this.headerItemColorObserver.observe(ionItem, { attributes: true, attributeFilter: ['color'] });
};

private getSlottedHeaderIonItem = () => {
const { headerEl } = this;
if (!headerEl) {
Expand Down Expand Up @@ -522,6 +574,7 @@ export class Accordion implements ComponentInterface {
'accordion-next': this.isNext,
'accordion-previous': this.isPrevious,
'accordion-last': this.isLast,
'accordion-has-header-item': this.hasHeaderItem,

'accordion-disabled': disabled,
'accordion-readonly': readonly,
Expand All @@ -542,6 +595,8 @@ export class Accordion implements ComponentInterface {
<slot name="header"></slot>
</div>

<div class="accordion-next-line" ref={(nextLineEl) => (this.nextLineEl = nextLineEl)}></div>

<div
id="content"
part={contentPart}
Expand Down
Loading
Loading