Feature request: expose Turnstile widget size (support compact)
-
The plugin always renders Cloudflare Turnstile at the default 300px “normal” size, which overflows narrow containers (sidebars, footer columns, mobile). Cloudflare supports a
compactsize (150px) for exactly this.Two spots would need it:
- The generated widget markup in
js/admin.js(~line 1293) β add adata-sizeattribute to the.cf-turnstilediv. - The re-render call in
js/mailin-front.js(~line 184) β pass size toturnstile.render().
Ideally this would be surfaced as an admin setting next to the existing theme (Auto/Dark/Light) option in the form captcha panel.
For now the clean CSS-only workaround I do is to scale the widget and reserve its scaled footprint. This does work with implicit rendering because it’s purely visual:
// footer / narrow-column Turnstile fit
.cf-turnstile {
transform: scale(0.85);
transform-origin: left top;
// reserve the scaled height so nothing below jumps
height: calc(65px * 0.85);
}Using the
transform-origin: left topkeeps it anchored to the column edge instead of drifting, and setting the scaled height stops the layout gap thattransformnormally leaves behind (transforms don’t affect layout box size). Adjust 0.85 to whatever makes 300px fit your need. - The generated widget markup in
You must be logged in to reply to this topic.