From 43a9a9782ace458ef5b949038763c9988b555771 Mon Sep 17 00:00:00 2001 From: theobenoit Date: Sat, 14 May 2022 14:46:20 +0200 Subject: [PATCH] Update close button --- README.md | 31 +++++++++++++++++++++++++++++++ package.json | 2 +- src/index.js | 5 +---- 3 files changed, 33 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 2fee91d..a8f4ec8 100644 --- a/README.md +++ b/README.md @@ -122,10 +122,41 @@ modal-popup.is-active { opacity: 1; } modal-popup > div { + position: relative; flex: 1; max-width: 48rem; margin: auto; padding: 2.4rem; background-color: #FFF; } + +/* Stylise le bouton de fermeture */ +modal-popup button[data-dismiss] { + cursor: pointer; + position: absolute; + top: 0; + right: 0; + appearance: none; + background: none; + border: none; + padding: 0; + margin: 0; + width: 50px; + height: 50px; +} +modal-popup button[data-dismiss]::before, +modal-popup button[data-dismiss]::after { + content: ''; + position: absolute; + top: 50%; + left: 50%; + width: 5px; + height: 20px; + background-color: #000; + transform: rotate(45deg) translate(-50%, -50%); + transform-origin: top left; +} +modal-popup button[data-dismiss]::after { + transform: rotate(-45deg) translate(-50%, -50%); +} ``` \ No newline at end of file diff --git a/package.json b/package.json index 6e0ab80..79d2019 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@antipodes-medical/modal-popup", - "version": "1.0.1", + "version": "1.0.2", "main": "src/index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1", diff --git a/src/index.js b/src/index.js index 9c2585e..ee6b4df 100644 --- a/src/index.js +++ b/src/index.js @@ -53,10 +53,7 @@ class Modal extends HTMLElement { aria-label="Close" title="Close" data-dismiss="dialog" - > - - - + > `; this.innerHTML = button + this.innerHTML;