diff --git a/src/element-overlay.ts b/src/element-overlay.ts index 8da00b5..30bfa28 100644 --- a/src/element-overlay.ts +++ b/src/element-overlay.ts @@ -18,12 +18,16 @@ export default class ElementOverlay { this.overlay.style.cursor = options.style?.cursor || "crosshair"; this.overlay.style.position = options.style?.position || "absolute"; this.overlay.style.zIndex = options.style?.zIndex || "2147483647"; + this.overlay.style.margin = options.style?.margin || "0px"; + this.overlay.style.padding = options.style?.padding || "0px"; this.shadowContainer = document.createElement("div"); this.shadowContainer.className = "_ext-element-overlay-container"; this.shadowContainer.style.position = "absolute"; this.shadowContainer.style.top = "0px"; this.shadowContainer.style.left = "0px"; + this.shadowContainer.style.margin = "0px"; + this.shadowContainer.style.padding = "0px"; this.shadowRoot = this.shadowContainer.attachShadow({ mode: "open" }); } diff --git a/src/utils.ts b/src/utils.ts index 9142eac..abf3715 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -15,6 +15,8 @@ export interface ElementOverlayStyleOptions { cursor?: string; position?: string; zIndex?: string; + margin?: string; + padding?: string; }; export type ElementOverlayOptions = {