Skip to content

Commit

Permalink
fix(backdrop): make backdrop visible in basic playground (#3200)
Browse files Browse the repository at this point in the history
Co-authored-by: Brandy Carney <brandyscarney@users.noreply.github.com>
  • Loading branch information
averyjohnston and brandyscarney authored Oct 17, 2023
1 parent 5da68c2 commit f3d1848
Show file tree
Hide file tree
Showing 9 changed files with 59 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/api/backdrop.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Backdrops are full screen components that overlay other components. They are use

## Basic Usage

The backdrop is transparent by default. The backdrop will prevent clicking or tapping on the content behind it.
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.

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

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
```css
ion-backdrop {
background: var(--ion-color-dark);
opacity: 0.3;
}
```
File renamed without changes.
7 changes: 7 additions & 0 deletions static/usage/v7/backdrop/basic/demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@
<script src="../../../common.js"></script>
<script type="module" src="https://cdn.jsdelivr.net/npm/@ionic/core@7/dist/ionic/ionic.esm.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@ionic/core@7/css/ionic.bundle.css" />

<style>
ion-backdrop {
background: var(--ion-color-dark);
opacity: 0.3;
}
</style>
</head>

<body>
Expand Down
26 changes: 23 additions & 3 deletions static/usage/v7/backdrop/basic/index.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,33 @@
import Playground from '@site/src/components/global/Playground';

import javascript from './javascript.md';
import react from './react.md';

import react_main_tsx from './react/main_tsx.md';
import react_main_css from './react/main_css.md';

import vue from './vue.md';
import angular from './angular.md';

import angular_example_component_css from './angular/example_component_css.md';
import angular_example_component_html from './angular/example_component_html.md';

<Playground
version="7"
code={{ javascript, react, vue, angular }}
code={{
javascript,
react: {
files: {
'src/main.tsx': react_main_tsx,
'src/main.css': react_main_css,
},
},
vue,
angular: {
files: {
'src/app/example.component.html': angular_example_component_html,
'src/app/example.component.css': angular_example_component_css,
},
},
}}
src="usage/v7/backdrop/basic/demo.html"
devicePreview={true}
/>
7 changes: 7 additions & 0 deletions static/usage/v7/backdrop/basic/javascript.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
```html
<style>
ion-backdrop {
background: var(--ion-color-dark);
opacity: 0.3;
}
</style>

<ion-backdrop visible="true"></ion-backdrop>
<div class="ion-page">
<ion-header>
Expand Down
6 changes: 6 additions & 0 deletions static/usage/v7/backdrop/basic/react/main_css.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
```css
ion-backdrop {
background: var(--ion-color-dark);
opacity: 0.3;
}
```
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import {
IonButton,
} from '@ionic/react';

import './main.css';

function Example() {
return (
<>
Expand Down
7 changes: 7 additions & 0 deletions static/usage/v7/backdrop/basic/vue.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
```html
<style>
ion-backdrop {
background: var(--ion-color-dark);
opacity: 0.3;
}
</style>

<template>
<ion-backdrop :visible="true"></ion-backdrop>
<div class="ion-page">
Expand Down

1 comment on commit f3d1848

@vercel
Copy link

@vercel vercel bot commented on f3d1848 Oct 17, 2023

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

ionic-docs – ./

ionic-docs-ionic1.vercel.app
ionic-docs-gqykycf8t.vercel.app
ionic-docs-git-main-ionic1.vercel.app

Please sign in to comment.