Skip to content
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
7afba1a
feat(content): add recipe and tokens
thetaPC Apr 24, 2026
32d2fdb
feat(content): cleanup
thetaPC Apr 30, 2026
57c3140
feat(content): more cleanup
thetaPC Apr 30, 2026
5983c3b
refactor(utils): created waitForComponent
thetaPC Apr 30, 2026
76a32dd
feat(styles): remove webkit-overflow-scrolling
thetaPC Apr 30, 2026
7646ae6
feat(content): improvements
thetaPC Apr 30, 2026
412806f
feat(contenet): remove transition theme
thetaPC Apr 30, 2026
c8f817c
refactor(contenet): update padding variables
thetaPC Apr 30, 2026
6a496be
feat(content): remove unused config
thetaPC May 4, 2026
2904ea8
feat(padding): add content padding
thetaPC May 4, 2026
ca169b0
feat(content): update to use new content padding variables
thetaPC May 4, 2026
6dd900b
feat(padding): update padding class
thetaPC May 4, 2026
ec21b54
Merge branch 'ionic-modular' of
thetaPC May 4, 2026
ec39980
feat(content): add css fallbacks
thetaPC May 5, 2026
7b8d89c
feat(content): update core ionic styles
thetaPC May 5, 2026
5d7fb5f
test(scripts): add deep merge
thetaPC May 5, 2026
68c7136
feat(content): remove fallbacks when necessary
thetaPC May 5, 2026
dab1803
feat(content): use global padding variables
thetaPC May 5, 2026
4704cc1
docs(content): add ion-padding comment
thetaPC May 6, 2026
94e7f36
feat(content): use new token for menu global style
thetaPC May 6, 2026
dddcd4e
docs(content): add internal variables reason
thetaPC May 6, 2026
095398c
feat(content): add a fallback for font-family
thetaPC May 6, 2026
32ea3b7
docs(content): add Jira ticket to TODO
thetaPC May 6, 2026
6f20e80
feat(config): clean up type
thetaPC May 8, 2026
bc743b4
feat(content): remove right property
thetaPC May 8, 2026
6337586
docs(BREAKING): add content
thetaPC May 8, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 8 additions & 10 deletions core/api.txt
Original file line number Diff line number Diff line change
Expand Up @@ -749,7 +749,6 @@ ion-content,prop,mode,"ios" | "md",undefined,false,false
ion-content,prop,scrollEvents,boolean,false,false,false
ion-content,prop,scrollX,boolean,false,false,false
ion-content,prop,scrollY,boolean,true,false,false
ion-content,prop,theme,"ios" | "md" | "ionic",undefined,false,false
ion-content,method,getScrollElement,getScrollElement() => Promise<HTMLElement>
ion-content,method,scrollByPoint,scrollByPoint(x: number, y: number, duration: number) => Promise<void>
ion-content,method,scrollToBottom,scrollToBottom(duration?: number) => Promise<void>
Expand All @@ -758,15 +757,14 @@ ion-content,method,scrollToTop,scrollToTop(duration?: number) => Promise<void>
ion-content,event,ionScroll,ScrollDetail,true
ion-content,event,ionScrollEnd,ScrollBaseDetail,true
ion-content,event,ionScrollStart,ScrollBaseDetail,true
ion-content,css-prop,--background
ion-content,css-prop,--color
ion-content,css-prop,--keyboard-offset
ion-content,css-prop,--offset-bottom
ion-content,css-prop,--offset-top
ion-content,css-prop,--padding-bottom
ion-content,css-prop,--padding-end
ion-content,css-prop,--padding-start
ion-content,css-prop,--padding-top
ion-content,css-prop,--ion-content-background
ion-content,css-prop,--ion-content-color
ion-content,css-prop,--ion-content-font-family
ion-content,css-prop,--ion-content-overflow
ion-content,css-prop,--ion-content-padding-bottom
ion-content,css-prop,--ion-content-padding-end
ion-content,css-prop,--ion-content-padding-start
ion-content,css-prop,--ion-content-padding-top
ion-content,part,background
ion-content,part,scroll

Expand Down
12 changes: 2 additions & 10 deletions core/src/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { RouteID, RouterDirection, RouterEventDetail, RouteWrite } from "./compo
import { BreadcrumbCollapsedClickEventDetail } from "./components/breadcrumb/breadcrumb-interface";
import { CheckboxChangeEventDetail } from "./components/checkbox/checkbox-interface";
import { IonChipFill, IonChipHue, IonChipShape, IonChipSize } from "./components/chip/chip.interfaces";
import { ScrollBaseDetail, ScrollDetail } from "./components/content/content-interface";
import { ScrollBaseDetail, ScrollDetail } from "./components/content/content.interfaces";
import { DatetimeChangeEventDetail, DatetimeHighlight, DatetimeHighlightCallback, DatetimeHourCycle, DatetimePresentation, FormatOptions, TitleSelectedDatesFormatter } from "./components/datetime/datetime-interface";
import { SpinnerTypes } from "./components/spinner/spinner-configs";
import { InputChangeEventDetail, InputInputEventDetail } from "./components/input/input-interface";
Expand Down Expand Up @@ -55,7 +55,7 @@ export { RouteID, RouterDirection, RouterEventDetail, RouteWrite } from "./compo
export { BreadcrumbCollapsedClickEventDetail } from "./components/breadcrumb/breadcrumb-interface";
export { CheckboxChangeEventDetail } from "./components/checkbox/checkbox-interface";
export { IonChipFill, IonChipHue, IonChipShape, IonChipSize } from "./components/chip/chip.interfaces";
export { ScrollBaseDetail, ScrollDetail } from "./components/content/content-interface";
export { ScrollBaseDetail, ScrollDetail } from "./components/content/content.interfaces";
export { DatetimeChangeEventDetail, DatetimeHighlight, DatetimeHighlightCallback, DatetimeHourCycle, DatetimePresentation, FormatOptions, TitleSelectedDatesFormatter } from "./components/datetime/datetime-interface";
export { SpinnerTypes } from "./components/spinner/spinner-configs";
export { InputChangeEventDetail, InputInputEventDetail } from "./components/input/input-interface";
Expand Down Expand Up @@ -1118,10 +1118,6 @@ export namespace Components {
* @default true
*/
"scrollY": boolean;
/**
* The theme determines the visual appearance of the component.
*/
"theme"?: "ios" | "md" | "ionic";
}
interface IonDatetime {
/**
Expand Down Expand Up @@ -7060,10 +7056,6 @@ declare namespace LocalJSX {
* @default true
*/
"scrollY"?: boolean;
/**
* The theme determines the visual appearance of the component.
*/
"theme"?: "ios" | "md" | "ionic";
}
interface IonDatetime {
/**
Expand Down
1 change: 0 additions & 1 deletion core/src/components/action-sheet/action-sheet.scss
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@
flex-shrink: 2;
overscroll-behavior-y: contain;
overflow-y: auto;
-webkit-overflow-scrolling: touch;
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.

-webkit-overflow-scrolling has become obsolete since iOS 13.

pointer-events: all;

background: var(--background);
Expand Down
1 change: 0 additions & 1 deletion core/src/components/alert/alert.ios.scss
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@

border-top: $alert-ios-list-border-top;
overflow-y: auto;
-webkit-overflow-scrolling: touch;
}

.alert-tappable {
Expand Down
1 change: 0 additions & 1 deletion core/src/components/alert/alert.scss
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@
.alert-message,
.alert-input-group {
box-sizing: border-box;
-webkit-overflow-scrolling: touch;
overflow-y: auto;
overscroll-behavior-y: contain;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,29 @@
import type { GestureDetail } from '../../interface';
import type { IonPadding } from '../../themes/themes.interfaces';

export interface IonContentRecipe {
background?: string;
color?: string;

font?: {
family?: string;
};

overflow?: string;

padding?: IonPadding;

transition?: {
cover?: {
background?: string;
opacity?: string;
};

shadow?: string;
};
}

export interface IonContentConfig {}

export interface ScrollBaseDetail {
isScrolling: boolean;
Expand Down
141 changes: 77 additions & 64 deletions core/src/components/content/content.scss
Original file line number Diff line number Diff line change
@@ -1,34 +1,27 @@
@import "../../themes/native/native.globals";
@use "../../themes/mixins" as mixins;
@use "../../themes/functions.color" as color;

// Content
// --------------------------------------------------

:host {
/**
* @prop --background: Background of the content
* @prop --ion-content-background: Background of the content
*
* @prop --color: Color of the content
* @prop --ion-content-color: Color of the content
*
* @prop --padding-top: Top padding of the content
* @prop --padding-end: Right padding if direction is left-to-right, and left padding if direction is right-to-left of the content
* @prop --padding-bottom: Bottom padding of the content
* @prop --padding-start: Left padding if direction is left-to-right, and right padding if direction is right-to-left of the content
* @prop --ion-content-font-family: Font family of the content
*
* @prop --keyboard-offset: Keyboard offset of the content
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.

I removed the comments for the internal variables.

* @prop --ion-content-overflow: Overflow behavior of the scrollable area
*
* @prop --offset-top: Offset top of the content
* @prop --offset-bottom: Offset bottom of the content
* @prop --ion-content-padding-top: Top padding of the content
* @prop --ion-content-padding-end: Right padding if direction is left-to-right, and left padding if direction is right-to-left of the content
* @prop --ion-content-padding-bottom: Bottom padding of the content
* @prop --ion-content-padding-start: Left padding if direction is left-to-right, and right padding if direction is right-to-left of the content
*/
--background: #{$background-color};
--color: #{$text-color};
--padding-top: 0px;
--padding-bottom: 0px;
--padding-start: 0px;
--padding-end: 0px;
--keyboard-offset: 0px;
--offset-top: 0px;
--offset-bottom: 0px;
--overflow: auto;
--internal-keyboard-offset: 0px;
--internal-offset-top: 0px;
--internal-offset-bottom: 0px;
Comment thread
ShaneK marked this conversation as resolved.

display: block;
position: relative;
Expand All @@ -44,36 +37,26 @@
padding: 0 !important;
/* stylelint-enable */

font-family: $font-family-base;
font-family: var(--ion-content-font-family);
Comment thread
ShaneK marked this conversation as resolved.
Outdated

contain: size style;
}

:host(.ion-color) .inner-scroll {
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.

There seems to be a lot deleted, but they were just moved around in the file.

background: current-color(base);
color: current-color(contrast);
}

#background-content {
@include position(calc(var(--offset-top) * -1), 0px, calc(var(--offset-bottom) * -1), 0px);

position: absolute;

background: var(--background);
}
// Content Inner Scroll
// ---------------------------------------------

.inner-scroll {
@include position(calc(var(--offset-top) * -1), 0px, calc(var(--offset-bottom) * -1), 0px);
@include padding(
calc(var(--padding-top) + var(--offset-top)),
var(--padding-end),
calc(var(--padding-bottom) + var(--keyboard-offset) + var(--offset-bottom)),
var(--padding-start)
@include mixins.position(calc(var(--internal-offset-top) * -1), 0px, calc(var(--internal-offset-bottom) * -1), 0px);
@include mixins.padding(
calc(var(--ion-content-padding-top) + var(--internal-offset-top)),
var(--ion-content-padding-end),
calc(var(--ion-content-padding-bottom) + var(--internal-keyboard-offset) + var(--internal-offset-bottom)),
var(--ion-content-padding-start)
);

position: absolute;

color: var(--color);
color: var(--ion-content-color);

box-sizing: border-box;

Expand All @@ -89,10 +72,16 @@
touch-action: pan-x pan-y pinch-zoom;
}

:host(.ion-color) .inner-scroll {
background: color.current-color(base);
color: color.current-color(contrast);
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.

I was going to switch this to use foreground as stated in the ticket but that lead to unwanted changes like:

Image

The text color is not readable in some components. Others, it's too light and I question if it would pass accessibility.

Image

We should look into the foreground values again.

}
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.

I didn't make this customizable because all themes are using the same styles. If the community requests it, then we can update the recipe to include it.


// Content Scroll
// ---------------------------------------------

.scroll-y,
.scroll-x {
-webkit-overflow-scrolling: touch;

/**
* This adds `.inner-scroll` as part of the
* stacking context in WebKit. Without it,
Expand All @@ -115,15 +104,29 @@
}

.scroll-y {
overflow-y: var(--overflow);
overflow-y: var(--ion-content-overflow);
overscroll-behavior-y: contain;
}

.scroll-x {
overflow-x: var(--overflow);
overflow-x: var(--ion-content-overflow);
overscroll-behavior-x: contain;
}

// Content Background
// ---------------------------------------------

#background-content {
@include mixins.position(calc(var(--internal-offset-top) * -1), 0px, calc(var(--internal-offset-bottom) * -1), 0px);

position: absolute;

background: var(--ion-content-background);
}

// Content Overscroll
// ---------------------------------------------

.overscroll::before,
.overscroll::after {
position: absolute;
Expand All @@ -142,6 +145,9 @@
top: -1px;
}

// Content Sizing
// ---------------------------------------------

:host(.content-sizing) {
display: flex;

Expand All @@ -159,6 +165,7 @@

contain: none;
}

:host(.content-sizing) .inner-scroll {
position: relative;

Expand All @@ -172,10 +179,34 @@
top: 0;
bottom: 0;

margin-top: calc(var(--offset-top) * -1);
margin-bottom: calc(var(--offset-bottom) * -1);
margin-top: calc(var(--internal-offset-top) * -1);
margin-bottom: calc(var(--internal-offset-bottom) * -1);
}

// Content Slotted Elements
// ---------------------------------------------

// Elements with the "fixed" slot
::slotted([slot="fixed"]) {
position: absolute;

/**
* When presenting ion-content inside of an ion-modal, the .inner-scroll
* element is composited. In WebKit, the fixed content is not composited
* causing it to appear under the main scrollable content as a result.
* The fixed content is correctly composited in other browsers. Adding
* the translateZ forces the fixed content to be composited so it correctly
* shows on top of the scrollable content. Setting a negative z-index will
* still allow the fixed content to appear under the scroll content if specified.
*/
transform: translateZ(0);
}

// Content: iOS Mode Transition
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.

The design doc did not account for animations based on mode. Should we be aiming to convert them to be based on themes? If so, then we can allow devs to customize the certain parts of the animations. In this instance, they could provide their preferred background color during the transition.
If we do decide to convert, then a ticket should be made and a TODO should be added here.

// The transition shadow effect is only animated by the iOS transition
// builder, so these styles are only rendered in iOS mode.
// ---------------------------------------------

.transition-effect {
display: none;
position: absolute;
Expand Down Expand Up @@ -238,21 +269,3 @@

transform: scaleX(-1);
}

// Content: Fixed
// --------------------------------------------------

::slotted([slot="fixed"]) {
position: absolute;

/**
* When presenting ion-content inside of an ion-modal, the .inner-scroll
* element is composited. In WebKit, the fixed content is not composited
* causing it to appear under the main scrollable content as a result.
* The fixed content is correctly composited in other browsers. Adding
* the translateZ forces the fixed content to be composited so it correctly
* shows on top of the scrollable content. Setting a negative z-index will
* still allow the fixed content to appear under the scroll content if specified.
*/
transform: translateZ(0);
}
Loading