mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-08 23:58:13 +08:00
feat(overlays): add global backdrop opacity variable for animations (#19533)
adds `--backdrop-opacity` to all overlays and `--ion-backdrop-opacity` for global control closes #16446
This commit is contained in:
@ -11,7 +11,7 @@ export const iosEnterAnimation = (baseEl: HTMLElement): IonicAnimation => {
|
||||
|
||||
backdropAnimation
|
||||
.addElement(baseEl.querySelector('ion-backdrop')!)
|
||||
.fromTo('opacity', 0.01, 0.3);
|
||||
.fromTo('opacity', 0.01, 'var(--backdrop-opacity)');
|
||||
|
||||
wrapperAnimation
|
||||
.addElement(baseEl.querySelector('.loading-wrapper')!)
|
||||
|
||||
@ -11,7 +11,7 @@ export const iosLeaveAnimation = (baseEl: HTMLElement): IonicAnimation => {
|
||||
|
||||
backdropAnimation
|
||||
.addElement(baseEl.querySelector('ion-backdrop')!)
|
||||
.fromTo('opacity', 0.3, 0);
|
||||
.fromTo('opacity', 'var(--backdrop-opacity)', 0);
|
||||
|
||||
wrapperAnimation
|
||||
.addElement(baseEl.querySelector('.loading-wrapper')!)
|
||||
|
||||
@ -11,7 +11,7 @@ export const mdEnterAnimation = (baseEl: HTMLElement): IonicAnimation => {
|
||||
|
||||
backdropAnimation
|
||||
.addElement(baseEl.querySelector('ion-backdrop')!)
|
||||
.fromTo('opacity', 0.01, 0.32);
|
||||
.fromTo('opacity', 0.01, 'var(--backdrop-opacity)');
|
||||
|
||||
wrapperAnimation
|
||||
.addElement(baseEl.querySelector('.loading-wrapper')!)
|
||||
|
||||
@ -11,7 +11,7 @@ export const mdLeaveAnimation = (baseEl: HTMLElement): IonicAnimation => {
|
||||
|
||||
backdropAnimation
|
||||
.addElement(baseEl.querySelector('ion-backdrop')!)
|
||||
.fromTo('opacity', 0.32, 0);
|
||||
.fromTo('opacity', 'var(--backdrop-opacity)', 0);
|
||||
|
||||
wrapperAnimation
|
||||
.addElement(baseEl.querySelector('.loading-wrapper')!)
|
||||
|
||||
Reference in New Issue
Block a user