Skip to content

Remove Tooltip JS positioning fallback once CSS Anchor Positioning reaches Baseline #117

Open

Description

@coloneljade

Context

Tooltip uses CSS Anchor Positioning (Chrome 131+ / Safari 26+) with a JS fallback for
Firefox and older Chrome. The fallback is in src/scripts/useTooltipPosition.ts and
the @supports not block in src/styles/Tooltip.module.css. Created alongside #95
(same Baseline dependency, separate component).

Problem/Opportunity

Once anchor-name + anchor-scope reach cross-browser Baseline, the JS fallback is dead
code. Removing it reduces bundle size and simplifies the component.

Suggested Approach

  1. Verify Baseline at https://web-platform-dx.github.io/web-features/
  2. Delete src/scripts/useTooltipPosition.ts
  3. Remove import and useTooltipPosition() call from Tooltip.tsx
  4. Remove the @supports not block from Tooltip.module.css
  5. Unwrap (promote to unconditional) the @supports block in Tooltip.module.css
  6. Also check if Remove CSS Anchor Positioning JS fallback once Firefox ships anchor-scope #95 (Dropdown) is ready to close at the same time

Activity

  1. added
    enhancement
    on Mar 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions