Skip to content

Commit

Permalink
feat(css): Add example of ::backdrop (#2175)
Browse files Browse the repository at this point in the history
* Backdrop & Marker

* Removed :marker

* Minor adjustments

---------

Co-authored-by: Estelle Weyl <estelle@openwebdocs.org>
  • Loading branch information
NiedziolkaMichal and estelle committed Jul 26, 2023
1 parent 9240bfd commit 6355aad
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 23 deletions.
8 changes: 8 additions & 0 deletions live-examples/css-examples/pseudo-element/backdrop.css
@@ -0,0 +1,8 @@
button {
font-size: 1.2rem;
padding: 5px 15px;
}

dialog::backdrop {
background-color: salmon;
}
8 changes: 8 additions & 0 deletions live-examples/css-examples/pseudo-element/backdrop.html
@@ -0,0 +1,8 @@
<button id="showDialogBtn">Show a dialog</button>

<dialog id="favDialog">
<form method="dialog">
<p>The background shown outside of this dialog is a backdrop.</p>
<button id="confirmBtn">Close the dialog</button>
</form>
</dialog>
4 changes: 4 additions & 0 deletions live-examples/css-examples/pseudo-element/backdrop.js
@@ -0,0 +1,4 @@
const showDialogBtn = document.getElementById('showDialogBtn');
const favDialog = document.getElementById('favDialog');

showDialogBtn.addEventListener('click', () => favDialog.showModal());
4 changes: 0 additions & 4 deletions live-examples/css-examples/pseudo-element/marker.css

This file was deleted.

10 changes: 0 additions & 10 deletions live-examples/css-examples/pseudo-element/marker.html

This file was deleted.

20 changes: 11 additions & 9 deletions live-examples/css-examples/pseudo-element/meta.json
Expand Up @@ -9,6 +9,17 @@
"defaultTab": "css",
"height": "tabbed-standard"
},
"backdrop": {
"exampleCode": "./live-examples/css-examples/pseudo-element/backdrop.html",
"cssExampleSrc": "./live-examples/css-examples/pseudo-element/backdrop.css",
"jsExampleSrc": "./live-examples/css-examples/pseudo-element/backdrop.js",
"fileName": "pseudo-element-backdrop.html",
"title": "HTML Demo: ::backdrop",
"type": "tabbed",
"defaultTab": "css",
"tabs": "html,css,js",
"height": "tabbed-shorter"
},
"before": {
"exampleCode": "./live-examples/css-examples/pseudo-element/before.html",
"cssExampleSrc": "./live-examples/css-examples/pseudo-element/before.css",
Expand Down Expand Up @@ -54,15 +65,6 @@
"defaultTab": "css",
"height": "tabbed-shorter"
},
"marker": {
"exampleCode": "./live-examples/css-examples/pseudo-element/marker.html",
"cssExampleSrc": "./live-examples/css-examples/pseudo-element/marker.css",
"fileName": "pseudo-element-marker.html",
"title": "HTML Demo: ::marker",
"type": "tabbed",
"defaultTab": "css",
"height": "tabbed-shorter"
},
"placeholder": {
"exampleCode": "./live-examples/css-examples/pseudo-element/placeholder.html",
"cssExampleSrc": "./live-examples/css-examples/pseudo-element/placeholder.css",
Expand Down

0 comments on commit 6355aad

Please sign in to comment.