0
Fork 0
mirror of https://github.com/penpot/penpot-plugins.git synced 2025-01-06 14:50:21 -05:00

feat: icon close

This commit is contained in:
Juanfran 2024-03-07 13:01:42 +01:00
parent 7cca9e6e0b
commit 1981e7c8d0

View file

@ -1,3 +1,6 @@
const closeSvg = `
<svg width="16" height="16"xmlns="http://www.w3.org/2000/svg" fill="none"><g class="fills"><rect rx="0" ry="0" width="16" height="16" class="frame-background"/></g><g class="frame-children"><path d="M11.997 3.997 8 8l-3.997 4.003m-.006-8L8 8l4.003 3.997" class="fills"/><g class="strokes"><path d="M11.997 3.997 8 8l-3.997 4.003m-.006-8L8 8l4.003 3.997" style="fill: none; stroke-width: 1; stroke: rgb(143, 157, 163); stroke-opacity: 1; stroke-linecap: round;" class="stroke-shape"/></g></g></svg>`;
export class PluginModalElement extends HTMLElement {
constructor() {
super();
@ -28,7 +31,7 @@ export class PluginModalElement extends HTMLElement {
const closeButton = document.createElement('button');
closeButton.setAttribute('type', 'button');
closeButton.textContent = '❌';
closeButton.innerHTML = `<div class="close">${closeSvg}</div>`;
closeButton.addEventListener('click', () => {
if (!this.shadowRoot) {
return;
@ -98,6 +101,8 @@ export class PluginModalElement extends HTMLElement {
h1 {
color: #000;
font-family: Arial, sans-serif;
margin: 0;
margin-block-end: 10px;
}
iframe {