diff --git a/demo/e2e/screenshot.spec.ts-snapshots/floating-action-button-fixed.png b/demo/e2e/screenshot.spec.ts-snapshots/floating-action-button-fixed.png index 8ad4c6f..da1b773 100644 Binary files a/demo/e2e/screenshot.spec.ts-snapshots/floating-action-button-fixed.png and b/demo/e2e/screenshot.spec.ts-snapshots/floating-action-button-fixed.png differ diff --git a/src/styles/components/ion-button.scss b/src/styles/components/ion-button.scss index bf8857e..0dde1f3 100644 --- a/src/styles/components/ion-button.scss +++ b/src/styles/components/ion-button.scss @@ -6,11 +6,11 @@ */ $scaleup-small: 1.12; -$scaleup-small-icon-only: 1.18; +$scaleup-small-icon-only: api.$button-scaleup-small-icon-only; $scaleup-default: 1.25; -$scaleup-default-icon-only: 1.32; +$scaleup-default-icon-only: api.$button-scaleup-default-icon-only; $scaleup-large: 1.12; -$scaleup-large-icon-only: 1.22; +$scaleup-large-icon-only: api.$button-scaleup-large-icon-only; @mixin theme-buttons { @include api.glass-background($shadow-opacity: 0.08); @@ -343,7 +343,11 @@ $scaleup-large-icon-only: 1.22; --color: rgba(var(--ion-color-base-rgb, var(--ion-text-color-rgb, 0, 0, 0)), 1); } &.ion-activated { - --opacity: 1; // for ion-back-button + &::part(native) { + @include api.glass-background-button-activated; + opacity: 1; + color: var(--color); + } --color: rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.1); &.ion-color { --color: rgba(var(--ion-color-base-rgb, var(--ion-text-color-rgb, 0, 0, 0)), 0.1); diff --git a/src/styles/components/ion-fab.scss b/src/styles/components/ion-fab.scss index b328a7d..01b15dc 100644 --- a/src/styles/components/ion-fab.scss +++ b/src/styles/components/ion-fab.scss @@ -1,8 +1,8 @@ @use '../utils/api'; -$scaleup-small-icon-only: 1.18; -$scaleup-default-icon-only: 1.2; -$scaleup-large-icon-only: 1.12; +$scaleup-small-icon-only: api.$button-scaleup-small-icon-only; +$scaleup-default-icon-only: api.$button-scaleup-default-icon-only; +$scaleup-large-icon-only: api.$button-scaleup-large-icon-only; ion-fab.ios:not(.ios26-disabled) { --transform-value: 2.5px; @@ -13,7 +13,7 @@ ion-fab.ios:not(.ios26-disabled) { ion-fab-button { --background: rgba(var(--ios26-glass-background-rgb), 0.72); --box-shadow: - inset 0 0 8px 0 rgba(var(--ios26-glass-box-shadow-color-rgb), 0.2), 0 0 10px 0 rgba(var(--ios26-glass-box-shadow-color-rgb), 0.82); + inset 0 0 8px 0 rgba(var(--ios26-glass-box-shadow-color-rgb), 0.2), 0 0.5px 1px 0 rgba(var(--ios26-glass-box-shadow-color-rgb), 0.08); --transition: var(--ios26-activated-transition-duration) transform cubic-bezier(0.25, 1.11, 0.78, 1.59), var(--ios26-activated-transition-duration) color ease; @@ -38,6 +38,7 @@ ion-fab.ios:not(.ios26-disabled) { &.ion-activated { --color: rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.1); &::part(native) { + @include api.glass-background-button-activated; transform: scale($scaleup-default-icon-only) translateZ(0); -webkit-transform: scale($scaleup-default-icon-only) translateZ(0); } @@ -59,10 +60,8 @@ ion-fab.ios:not(.ios26-disabled) { } &::part(native) { - @include api.glass-background($include-background: false, $include-box-shadow: false); - // The previous background shorthand reset Ionic's padding-box default. - // There is no CSS custom property for background-clip, so preserve it via the Part. background-clip: border-box; + @include api.glass-background($include-background: false, $include-box-shadow: false); } } diff --git a/src/styles/utils/api.scss b/src/styles/utils/api.scss index af762cd..f2d843c 100644 --- a/src/styles/utils/api.scss +++ b/src/styles/utils/api.scss @@ -1,3 +1,7 @@ +$button-scaleup-small-icon-only: 1.18; +$button-scaleup-default-icon-only: 1.38; +$button-scaleup-large-icon-only: 1.22; + $_glass-surface: linear-gradient( 180deg, rgba(var(--ion-text-color-rgb, 0, 0, 0), 0) 4%, @@ -80,6 +84,9 @@ $_glass-surface: linear-gradient( } @mixin glass-background-button-activated { + background-color: rgba(var(--ios26-glass-background-rgb), 0.96); + border-color: rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.12) rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.32) + rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.16) rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.28); box-shadow: inset 0 0 0 0.5px rgba(var(--ios26-glass-border-color-rgb), 0.95), inset 0 1px 3px 0 rgba(var(--ios26-glass-border-color-rgb), 0.85), @@ -96,6 +103,8 @@ $_glass-surface: linear-gradient( ) { @if $include-background { background: rgba(var(--ios26-button-color-selected-rgb), $opacity); + } @else { + background-color: rgba(var(--ios26-button-color-selected-rgb), $opacity); } backdrop-filter: blur($blur) saturate($saturate); @if $include-box-shadow { @@ -109,9 +118,6 @@ $_glass-surface: linear-gradient( background-clip: border-box; background-origin: padding-box; - // Hardware acceleration optimization for glass effects - transform: translateZ(0); - -webkit-transform: translateZ(0); -webkit-backface-visibility: hidden; backface-visibility: hidden; } diff --git a/src/styles/utils/dark/ion-button.scss b/src/styles/utils/dark/ion-button.scss index c64e704..2d2f3fd 100644 --- a/src/styles/utils/dark/ion-button.scss +++ b/src/styles/utils/dark/ion-button.scss @@ -37,7 +37,7 @@ --color: rgba(var(--ion-color-base-rgb, var(--ion-text-color-rgb, 0, 0, 0)), 1); } &::part(native) { - @include api.glass-background-button-activated-dark($include-background: false, $include-box-shadow: $is-back-button); + @include api.glass-background-button-activated-dark($include-background: false); } ion-icon { color: rgb(255, 255, 255); @@ -49,10 +49,10 @@ ion-buttons.ios:not(.ios26-disabled):not(:has(ion-back-button, ion-button:not(.button-clear))) { @include theme-dark-buttons; } - ion-button:not(.ios26-disabled) { + ion-button.ios:not(.ios26-disabled) { @include theme-dark-button; } - ion-back-button:not(.ios26-disabled) { + ion-back-button.ios:not(.ios26-disabled) { @include theme-dark-button($is-back-button: true); } } diff --git a/src/styles/utils/dark/ion-fab.scss b/src/styles/utils/dark/ion-fab.scss index fc36a99..b693320 100644 --- a/src/styles/utils/dark/ion-fab.scss +++ b/src/styles/utils/dark/ion-fab.scss @@ -4,6 +4,9 @@ ion-fab.ios:not(.ios26-disabled) { ion-fab-button { &.ion-activated { + &::part(native) { + @include api.glass-background-button-activated-dark($include-background: false); + } --color: rgba(var(--ion-text-color-rgb, 0, 0, 0), 1); &.ion-color {