Skip to content

Commit a37098e

Browse files
authored
feat(backdrop): ionic theme styles (#29873)
Issue number: internal --------- <!-- Please do not submit updates to dependencies unless it fixes an issue. --> <!-- Please try to limit your pull request to one type (bugfix, feature, etc). Submit multiple pull requests if needed. --> ## What is the current behavior? <!-- Please describe the current behavior that you are modifying. --> No Ionic theme styles for the `ion-backdrop` element ## What is the new behavior? <!-- Please describe the behavior or changes that are being added by this PR. --> Adds Ionic theme styles for `ion-backdrop` and updates snapshots. ## Does this introduce a breaking change? - [ ] Yes - [x] No <!-- If this introduces a breaking change: 1. Describe the impact and migration path for existing applications below. 2. Update the BREAKING.md file with the breaking change. 3. Add "BREAKING CHANGE: [...]" to the commit description when merging. See https://github.com/ionic-team/ionic-framework/blob/main/docs/CONTRIBUTING.md#footer for more information. --> ## Other information <!-- Any other information that is important to this PR such as screenshots of how the component looks before and after the change. --> The backdrop changes were only applied to `ion-modal` for now as all other components where `ion-backdrop` is used do not yet have dedicated Ionic theme styles. This is relevant as those components will need to set `--backdrop-opacity: <value>` for their own implementations.
1 parent 60e6b31 commit a37098e

File tree

24 files changed

+12
-1
lines changed

24 files changed

+12
-1
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
@use "../../themes/ionic/ionic.globals.scss" as globals;
2+
@import "./backdrop";
3+
4+
:host {
5+
background-color: rgba(globals.$ionic-color-base-black-rgb, 0.7);
6+
backdrop-filter: blur(2px);
7+
}

core/src/components/backdrop/backdrop.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { getIonTheme } from '../../global/ionic-global';
1212
styleUrls: {
1313
ios: 'backdrop.ios.scss',
1414
md: 'backdrop.md.scss',
15-
ionic: 'backdrop.md.scss',
15+
ionic: 'backdrop.ionic.scss',
1616
},
1717
shadow: true,
1818
})

core/src/components/modal/modal.ionic.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
// Ionic Modal
55
// --------------------------------------------------
66

7+
:host {
8+
--backdrop-opacity: 1;
9+
}
10+
711
// Shape
812
// -------------------------------------
913
:host(.modal-round) {
623 Bytes
Loading
485 Bytes
Loading
529 Bytes
Loading
623 Bytes
Loading
485 Bytes
Loading
529 Bytes
Loading
179 Bytes
Loading

0 commit comments

Comments
 (0)