Skip to content

Commit f3d1848

Browse files
fix(backdrop): make backdrop visible in basic playground (#3200)
Co-authored-by: Brandy Carney <[email protected]>
1 parent 5da68c2 commit f3d1848

File tree

9 files changed

+59
-4
lines changed

9 files changed

+59
-4
lines changed

docs/api/backdrop.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Backdrops are full screen components that overlay other components. They are use
1616

1717
## Basic Usage
1818

19-
The backdrop is transparent by default. The backdrop will prevent clicking or tapping on the content behind it.
19+
The backdrop prevents clicking or tapping on the content behind it. It is transparent by default, so the below demo includes CSS to make it visible.
2020

2121
import Basic from '@site/static/usage/v7/backdrop/basic/index.md';
2222

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
```css
2+
ion-backdrop {
3+
background: var(--ion-color-dark);
4+
opacity: 0.3;
5+
}
6+
```

static/usage/v7/backdrop/basic/demo.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@
88
<script src="../../../common.js"></script>
99
<script type="module" src="https://cdn.jsdelivr.net/npm/@ionic/core@7/dist/ionic/ionic.esm.js"></script>
1010
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@ionic/core@7/css/ionic.bundle.css" />
11+
12+
<style>
13+
ion-backdrop {
14+
background: var(--ion-color-dark);
15+
opacity: 0.3;
16+
}
17+
</style>
1118
</head>
1219

1320
<body>
Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,33 @@
11
import Playground from '@site/src/components/global/Playground';
22

33
import javascript from './javascript.md';
4-
import react from './react.md';
4+
5+
import react_main_tsx from './react/main_tsx.md';
6+
import react_main_css from './react/main_css.md';
7+
58
import vue from './vue.md';
6-
import angular from './angular.md';
9+
10+
import angular_example_component_css from './angular/example_component_css.md';
11+
import angular_example_component_html from './angular/example_component_html.md';
712

813
<Playground
914
version="7"
10-
code={{ javascript, react, vue, angular }}
15+
code={{
16+
javascript,
17+
react: {
18+
files: {
19+
'src/main.tsx': react_main_tsx,
20+
'src/main.css': react_main_css,
21+
},
22+
},
23+
vue,
24+
angular: {
25+
files: {
26+
'src/app/example.component.html': angular_example_component_html,
27+
'src/app/example.component.css': angular_example_component_css,
28+
},
29+
},
30+
}}
1131
src="usage/v7/backdrop/basic/demo.html"
1232
devicePreview={true}
1333
/>

static/usage/v7/backdrop/basic/javascript.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
```html
2+
<style>
3+
ion-backdrop {
4+
background: var(--ion-color-dark);
5+
opacity: 0.3;
6+
}
7+
</style>
8+
29
<ion-backdrop visible="true"></ion-backdrop>
310
<div class="ion-page">
411
<ion-header>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
```css
2+
ion-backdrop {
3+
background: var(--ion-color-dark);
4+
opacity: 0.3;
5+
}
6+
```

static/usage/v7/backdrop/basic/react.md renamed to static/usage/v7/backdrop/basic/react/main_tsx.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ import {
1111
IonButton,
1212
} from '@ionic/react';
1313

14+
import './main.css';
15+
1416
function Example() {
1517
return (
1618
<>

static/usage/v7/backdrop/basic/vue.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
```html
2+
<style>
3+
ion-backdrop {
4+
background: var(--ion-color-dark);
5+
opacity: 0.3;
6+
}
7+
</style>
8+
29
<template>
310
<ion-backdrop :visible="true"></ion-backdrop>
411
<div class="ion-page">

0 commit comments

Comments
 (0)