diff --git a/packages/cookie-banner/src/activation.ts b/packages/cookie-banner/src/activation.ts index 89665b844..2e6184a6c 100644 --- a/packages/cookie-banner/src/activation.ts +++ b/packages/cookie-banner/src/activation.ts @@ -146,6 +146,18 @@ function createPlaceholder( "margin-right", "margin-bottom", "margin-left", + "padding", + "padding-top", + "padding-right", + "padding-bottom", + "padding-left", + "box-sizing", + "position", + "top", + "right", + "bottom", + "left", + "inset", ]; if (htmlEl.style) { for (const prop of DIMENSIONAL_PROPS) { @@ -154,6 +166,15 @@ function createPlaceholder( } } + const hasExplicitHeight = + placeholder.style.height || placeholder.style.minHeight; + if (!hasExplicitHeight) { + const computed = window.getComputedStyle(htmlEl); + if (computed.height && computed.height !== "auto" && computed.height !== "0px") { + placeholder.style.height = computed.height; + } + } + let phText: string; if (texts?.placeholder_text) { const parts = texts.placeholder_text.split("{{category}}");