Skip to content

docs(carto-create-builder-maps): add wrapper background rule to popup HTML templates#37

Open
anamanvil wants to merge 1 commit into
masterfrom
claude/popup-template-background
Open

docs(carto-create-builder-maps): add wrapper background rule to popup HTML templates#37
anamanvil wants to merge 1 commit into
masterfrom
claude/popup-template-background

Conversation

@anamanvil

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #36, found while visually verifying the recipe.

Tooltip surfaces (light, lightWithHiFirst, dark, darkWithHiFirst) suppress the popup card chrome when templateMode: true — the template IS the whole popup. If the outer <div> has border-radius / box-shadow / overflow: hidden but no background, the body renders transparently over the basemap and the text floats against the map.

The panel surface masked this bug because the docked side panel paints its own white chrome behind any template, so the same wrapper that "worked" on panel breaks the moment the author switches the click style to light. Caught it in a live demo map with a Supermarket popup over Buffalo, WY where the body text was sitting on top of the basemap.

  • New subsection "Set a background on the outer wrapper" beside the close-✕ headroom rule, explaining the chrome suppression and the per-style background colour (#fff for light, #1d2733 for dark).
  • Recipe now sets background: #fff on the outer <div> so it renders identically on light / dark / panel without further edits.
  • Trailing prose rewritten to enumerate the three details that together make the recipe portable: background, 32 px right padding, solid header fill.

Single file: popups.md.

Test plan

  • make validate — 523 snippets validated
  • Verified visually in Builder: previously transparent body now renders on a proper white card with the same shadow + rounded corners the header was already implying

… HTML templates

Discovered while visually verifying the prior gradient/close-✕ fix:
tooltip surfaces (`light`, `lightWithHiFirst`, `dark`, `darkWithHiFirst`)
suppress the popup card chrome when `templateMode: true`, so a template
whose outer wrapper has `border-radius` / `box-shadow` / `overflow: hidden`
but NO `background` renders transparently over the basemap — text floats
against the map and is often unreadable.

The bug was masked by the `panel` surface, which paints its own white
chrome behind any template, so the same wrapper that "worked" on `panel`
breaks the moment the author switches the click style to `light`.

- Add a new subsection "Set a background on the outer wrapper" right
  beside the close-✕ headroom rule, spelling out the chrome-suppression
  behaviour and the per-style background colour to use (`#fff` for
  light, `#1d2733` for dark).
- Update the concrete recipe to include `background: #fff` on the outer
  `<div>` so it is portable across `light` / `dark` / `panel` without
  edits.
- Rewrite the trailing prose to enumerate the three details that make
  the recipe portable (background, 32 px right padding, solid fill).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@anamanvil anamanvil force-pushed the claude/popup-template-background branch from ea85f4a to 1d0ab27 Compare May 19, 2026 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant