Skip to content

fix(ui): a host's root font size shrinks the side panel #238

Closed

Description

@Ardnived

Summary

On a host whose root font size is not 16px, the widget's side panel shrinks and its text wraps letter by letter ("Kingdo/m", "Canad/a"), while the map camera still pads for a 352px panel. Twenty Twenty (on the fleet) and OceanWP set html { font-size: 62.5% }; the panel measures about 220px on both. Found by the plugin's browser lane (sydevs/SahajAtlasWordpress#38): cells twentytwenty, oceanwp, root-font, fixed-header.

Approach

TAILWIND_REM_TO_PX already converts most of the scale to px, but several values stay in rem:

  • w-[var(--sy-drawer-w,22rem)] and max-w-[calc(100%-2rem)] (src/components/atoms/Drawer/Drawer.tsx:80-87)
  • max-w-[var(--sy-content-max,32rem)] (Drawer.tsx:33,39)
  • the cog offset calc(var(--sy-drawer-w,22rem)+2rem|3rem) (src/views/DrawerStack/DrawerStack.tsx:823)
  • max-w-[6rem] (ActionRow.tsx:42), the Modal's calc(…-2rem) (Modal.tsx:42)
  • globals.css:301,456-458, vaul.css:162,176-177, and the Schedule-X calendar CSS

src/hooks/use-map-controller-real.tsx:40-41 hard-codes 22 * 16. Convert the remaining values to px (the drawer width to 352px), and add a build assertion that fails on a rem in the injected CSS outside the calendar chunk.

Acceptance criteria

  • With html { font-size: 62.5% } on the host, the side panel is 352px wide and no list label wraps mid-word.
  • The map camera's left padding matches the panel's rendered width.

Verification checklist

  • pnpm build fails if a non-calendar injected stylesheet contains rem.
  • In SahajAtlasWordpress, pnpm test:browser --only twentytwenty,root-font reports no "side panel keeps its width" finding.

Notes

From the 2026-09-30 integration audit (finding C3).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Fields

    Priority

    Medium

    Hold Until

    None yet

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions