Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
23 changes: 23 additions & 0 deletions BREAKING.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ This is a comprehensive list of the breaking changes introduced in the major ver

- [Global Styles](#version-10x-global-styles)
- [Components](#version-10x-components)
- [Backdrop](#version-10x-backdrop)
- [Button](#version-10x-button)
- [Card](#version-10x-card)
- [Checkbox](#version-10x-checkbox)
Expand Down Expand Up @@ -51,6 +52,28 @@ This is a comprehensive list of the breaking changes introduced in the major ver

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

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

The following breaking changes apply to `ion-backdrop`:

1. The `--ion-backdrop-color` global variable has been replaced. <sup>[1](#version-10x-backdrop-replaced-css-variables)</sup>
2. Theme classes (`ion-backdrop.md`, `ion-backdrop.ios`) are no longer supported. <sup>[2](#version-10x-backdrop-theme-classes)</sup>

<h5 id="version-10x-backdrop-replaced-css-variables">Replaced CSS variables</h5>

Use the new token structure for global styles, or the corresponding CSS variable for component-specific overrides:

| Old (9.x) | New token (global) | New CSS variable (component-specific) |
|---|---|---|
| `--ion-backdrop-color` | `IonBackdrop.background` | `--ion-backdrop-background` |

> [!NOTE]
> `--ion-backdrop-color` was set on `:root`, and `--ion-backdrop-background` has no effect there. Set it on the backdrop of each overlay instead: `ion-alert ion-backdrop` for alert, action sheet and loading, and the `backdrop` part for menu, modal and popover (`ion-modal::part(backdrop)`).

<h5 id="version-10x-backdrop-theme-classes">Theme classes</h5>

Remove any instances that target the theme classes: `ion-backdrop.md`, `ion-backdrop.ios`.

<h4 id="version-10x-button">Button</h4>

- The `border-radius` of the `ios` and `md` button now defaults to `6px` and `999px` instead of `14px` and `4px`, respectively, in accordance with the iOS and Material Design 3 guidelines. To revert to the previous appearance, set the `shape` to `"soft"` for `md` and override the `--border-radius` CSS variable for `ios` to `14px`, or set it to a different value entirely.
Expand Down
2 changes: 1 addition & 1 deletion core/api.txt
Original file line number Diff line number Diff line change
Expand Up @@ -308,9 +308,9 @@ ion-backdrop,shadow
ion-backdrop,prop,mode,"ios" | "md",undefined,false,false
ion-backdrop,prop,stopPropagation,boolean,true,false,false
ion-backdrop,prop,tappable,boolean,true,false,false
ion-backdrop,prop,theme,"ios" | "md" | "ionic",undefined,false,false
ion-backdrop,prop,visible,boolean,true,false,false
ion-backdrop,event,ionBackdropTap,void,true
ion-backdrop,css-prop,--ion-backdrop-background

ion-badge,shadow
ion-badge,prop,color,"danger" | "dark" | "light" | "medium" | "primary" | "secondary" | "success" | "tertiary" | "warning" | string & Record<never, never> | undefined,undefined,false,true
Expand Down
8 changes: 0 additions & 8 deletions core/src/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -469,10 +469,6 @@ export namespace Components {
* @default true
*/
"tappable": boolean;
/**
* The theme determines the visual appearance of the component.
*/
"theme"?: "ios" | "md" | "ionic";
/**
* If `true`, the backdrop will be visible. This property controls whether or not the backdrop's default background is shown. It does not control whether or not the backdrop blocks interaction, and it does not override a custom background set on `ion-backdrop`.
* @default true
Expand Down Expand Up @@ -6316,10 +6312,6 @@ declare namespace LocalJSX {
* @default true
*/
"tappable"?: boolean;
/**
* The theme determines the visual appearance of the component.
*/
"theme"?: "ios" | "md" | "ionic";
/**
* If `true`, the backdrop will be visible. This property controls whether or not the backdrop's default background is shown. It does not control whether or not the backdrop blocks interaction, and it does not override a custom background set on `ion-backdrop`.
* @default true
Expand Down
3 changes: 3 additions & 0 deletions core/src/components/backdrop/_backdrop.docs.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/**
* @prop --ion-backdrop-background: Background of the backdrop
*/
3 changes: 3 additions & 0 deletions core/src/components/backdrop/backdrop.interface.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export interface IonBackdropRecipe {
background?: string;
}
8 changes: 0 additions & 8 deletions core/src/components/backdrop/backdrop.ionic.scss

This file was deleted.

6 changes: 0 additions & 6 deletions core/src/components/backdrop/backdrop.ios.scss

This file was deleted.

6 changes: 0 additions & 6 deletions core/src/components/backdrop/backdrop.md.scss

This file was deleted.

9 changes: 0 additions & 9 deletions core/src/components/backdrop/backdrop.native.scss

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,20 +1,28 @@
@import "../../themes/mixins.scss";
@use "../../themes/common.globals" as globals;
@use "../../themes/mixins" as mixins;
@use "./backdrop.docs";

// Backdrop
// --------------------------------------------------

:host {
@include position(0, 0, 0, 0);
@include mixins.position(0, 0, 0, 0);

display: block;
position: absolute;

transform: translateZ(0);

background-color: var(--ion-backdrop-background);

contain: strict;
cursor: pointer;

// Nearly transparent until an overlay or menu animation fades it in
opacity: 0.01;
touch-action: none;

z-index: globals.$z-index-backdrop;
}

:host(.backdrop-hide) {
Expand Down
17 changes: 5 additions & 12 deletions core/src/components/backdrop/backdrop.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
import type { ComponentInterface, EventEmitter } from '@stencil/core';
import { Component, Event, Host, Listen, Prop, h } from '@stencil/core';

import { getIonTheme } from '../../global/ionic-global';

/**
* @virtualProp {"ios" | "md"} mode - The mode determines the platform behaviors of the component.
* @virtualProp {"ios" | "md" | "ionic"} theme - The theme determines the visual appearance of the component.
*/
@Component({
tag: 'ion-backdrop',
styleUrls: {
ios: 'backdrop.ios.scss',
md: 'backdrop.md.scss',
ionic: 'backdrop.ionic.scss',
},
styleUrl: 'backdrop.scss',
shadow: true,
})
export class Backdrop implements ComponentInterface {
Expand Down Expand Up @@ -57,14 +50,14 @@ export class Backdrop implements ComponentInterface {
}

render() {
const theme = getIonTheme(this);
const { tappable, visible } = this;

return (
<Host
aria-hidden="true"
class={{
[theme]: true,
'backdrop-hide': !this.visible,
'backdrop-no-tappable': !this.tappable,
'backdrop-hide': !visible,
'backdrop-no-tappable': !tappable,
}}
></Host>
);
Expand Down
1 change: 1 addition & 0 deletions core/src/themes/common.globals.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ $screen-breakpoints: (
// Z-Index
// --------------------------------------------------
$z-index-page-container: 0;
$z-index-backdrop: 2;
6 changes: 5 additions & 1 deletion core/src/themes/ionic/default.tokens.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { currentColor, mix, dynamicFont, ionColor } from '../../utils/theme';
import { rgba, currentColor, mix, dynamicFont, ionColor } from '../../utils/theme';
import { defaultTheme as baseDefaultTheme } from '../base/default.tokens';
import { colors as baseColors } from '../base/shared.tokens';
import type { DefaultTheme } from '../themes.interfaces';
Expand Down Expand Up @@ -113,6 +113,10 @@ export const defaultTheme: DefaultTheme = {
},

components: {
IonBackdrop: {
background: rgba('19, 21, 24', 0.7),
},

IonBadge: {
// Hues
hue: {
Expand Down
4 changes: 4 additions & 0 deletions core/src/themes/ios/default.tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,10 @@ export const defaultTheme: DefaultTheme = {
},

components: {
IonBackdrop: {
background: baseColors.black,
},

IonBadge: {
font: {
family: 'var(--ion-font-family)',
Expand Down
4 changes: 4 additions & 0 deletions core/src/themes/md/default.tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@ export const defaultTheme: DefaultTheme = {
},

components: {
IonBackdrop: {
background: baseColors.black,
},

IonBadge: {
font: {
family: 'var(--ion-font-family)',
Expand Down
1 change: 0 additions & 1 deletion core/src/themes/native/native.globals.scss
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ $z-index-toolbar: 10;
$z-index-toolbar-background: -1;
$z-index-toolbar-buttons: 99;

$z-index-backdrop: 2;
$z-index-overlay-wrapper: 10;

$z-index-item-options: 1;
Expand Down
1 change: 0 additions & 1 deletion core/src/themes/native/native.theme.default.ios.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

// iOS General Colors
// --------------------------------------------------
$backdrop-ios-color: var(--ion-backdrop-color, #000);
$overlay-ios-background-color: var(--ion-overlay-background-color, var(--ion-background-color-step-100, #f9f9f9));

// iOS Tabs & Tab bar
Expand Down
1 change: 0 additions & 1 deletion core/src/themes/native/native.theme.default.md.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

// Material Design General Colors
// --------------------------------------------------
$backdrop-md-color: var(--ion-backdrop-color, #000);
$border-md-color: var(--ion-border-color, var(--ion-background-color-step-150, #c1c4cd));
$overlay-md-background-color: var(--ion-overlay-background-color, var(--ion-background-color, #fff));

Expand Down
7 changes: 6 additions & 1 deletion core/src/themes/native/test/css-variables/css/oceanic.css
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@
--ion-color-dark-tint: #343d46;

/* Component Colors */
--ion-backdrop-color: #1b2b34;
--ion-overlay-background-color: #142129;

--ion-border-color: #1b2b34;
Expand Down Expand Up @@ -138,3 +137,9 @@
--ion-text-color-step-950: #324048;
--ion-text-color-step-1000: #26363e;
}

ion-action-sheet ion-backdrop,
ion-alert ion-backdrop,
ion-loading ion-backdrop {
--ion-backdrop-background: #1b2b34;
}
2 changes: 2 additions & 0 deletions core/src/themes/themes.interfaces.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import type { IonBackdropRecipe } from '../components/backdrop/backdrop.interface';
import type { IonBadgeConfig, IonBadgeRecipe } from '../components/badge/badge.interface';
import type { IonChipConfig, IonChipRecipe } from '../components/chip/chip.interface';
import type { IonColRecipe } from '../components/col/col.interface';
Expand Down Expand Up @@ -297,6 +298,7 @@ export type DefaultTheme = BaseTheme & {

type Components = {
IonAvatar?: any;
IonBackdrop?: IonBackdropRecipe;
IonBadge?: IonBadgeRecipe;
IonChip?: IonChipRecipe;
IonCol?: IonColRecipe;
Expand Down
Loading
Loading