Skip to content
Merged
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 8 additions & 4 deletions src/styles/components/ion-button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
}
Comment on lines +346 to +350

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 システム設定のダークモードで押下ボタンがライト配色になる

通常テーマの押下ルールはダーク側より詳細度が高く、新しい背景色、枠線、影を上書きさせません。system版とalways版では、押下ボタンがライト用ガラス配色になります。

Learn more

通常テーマのセレクターには .ios があり、クラス相当の詳細度がダーク側より1つ高くなります。そのため、後から読み込まれる ダーク用mixinbackground-color、border、box-shadowでも、この追加ルールを上書きできません。.ion-palette-darkで囲むclass版は親クラスで詳細度が増えますが、system版とalways版にはその親がありません。

Example: ionic-theme-ios26.scssionic-theme-ios26-dark-system.scss を読み込み、OSをダーク設定にしてdefault fillのボタンを押します。ダーク側はselected色の56%背景を指定しますが、通常側のglass背景96%と通常側の輪郭・影が勝ちます。

Recommended fix: system版とalways版でもダーク側のセレクターが通常側以上の詳細度になるよう、theme-dark-buttonの対象に同じ.ios条件を追加してください。FABのように同一要素へ競合するプロパティについては、生成CSSの詳細度と読み込み順の両方を確認してください。

Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

--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);
Expand Down
13 changes: 6 additions & 7 deletions src/styles/components/ion-fab.scss
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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;
Expand All @@ -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);
}
Expand All @@ -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);
}
}

Expand Down
12 changes: 9 additions & 3 deletions src/styles/utils/api.scss
Original file line number Diff line number Diff line change
@@ -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%,
Expand Down Expand Up @@ -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),
Expand All @@ -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 {
Expand All @@ -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;
}
Expand Down
6 changes: 3 additions & 3 deletions src/styles/utils/dark/ion-button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
}
}
3 changes: 3 additions & 0 deletions src/styles/utils/dark/ion-fab.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Comment on lines +7 to +9

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 ダークモードで押下中のFABが拡大されない

ダークテーマでは、このmixinが後からtransform: translateZ(0)を出力し、通常テーマのscaleを上書きします。そのため、FABの押下時だけ拡大しません。

Learn more

glass-background-button-activated-dark は背景や枠線だけでなく、transform: translateZ(0) も生成します。このルールは通常テーマの 押下時scale と同じ要素、同じ詳細度に適用され、ダークテーマ側が後勝ちします。結果として背景は切り替わりますが、scale成分が失われます。

Example: 通常サイズのFABをダークモードで押すと、通常テーマが設定した scale(1.38) translateZ(0)translateZ(0) に置換されます。ライトモードでは1.38倍に拡大しますが、ダークモードでは等倍のままです。

Recommended fix: ダーク用mixinからtransformを分離するか、FAB向け呼び出しではtransformを生成しないオプションを追加してください。あるいは、ダーク側でsmall/default/largeそれぞれのscaleを保持したtransformを再指定してください。

Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

--color: rgba(var(--ion-text-color-rgb, 0, 0, 0), 1);

&.ion-color {
Expand Down
Loading