Skip to content

Commit

Permalink
Fix margin/padding
Browse files Browse the repository at this point in the history
  • Loading branch information
iamacup committed Oct 18, 2023
1 parent c6c3769 commit a6c94ea
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/element-overlay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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" });
}

Expand Down
2 changes: 2 additions & 0 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ export interface ElementOverlayStyleOptions {
cursor?: string;
position?: string;
zIndex?: string;
margin?: string;
padding?: string;
};

export type ElementOverlayOptions = {
Expand Down

0 comments on commit a6c94ea

Please sign in to comment.