react-grab@0.1.46

aidenybai/react-grabreact-grab@0.1.46Jun 17, 2026by github-actions[bot]

AI Summary

Makes app theme detection more robust by supporting oklch colors and dual color-scheme values.

Key Highlights

  • Fixes theme detection for pages using oklch() background colors.
  • Correctly handles dual color-scheme values (e.g., `light dark`).
  • Inspects `<body>` in addition to `<html>` for theme markers.

Full Release Notes

### Patch Changes

- b85b9b1: Make app theme detection (which drives the overlay's inverted theme) more robust:

  - Read background luminance through the existing `parseAnyColor` helper so pages whose background is authored with `oklch()` (e.g. Tailwind v4) are no longer mis-detected. Browsers serialize these computed colors in their own color space rather than `rgb()`, so the previous `rgb()`-only luminance heuristic silently failed and fell back to `prefers-color-scheme` — a forced-light page then looked dark to dark-OS visitors.
  - Treat a dual `color-scheme` (`light dark` / `dark light`) as "decided by the OS preference / actual paint" instead of blindly trusting the first listed token, which mis-detected dark-OS visitors on sites that opt into both schemes.
  - Inspect `<body>` in addition to `<html>` for theme markers (class, `data-theme`/`data-bs-theme`/etc., and presence attributes) so apps that theme the body are detected.
  - Fall back from the body background to the root element when the body background is transparent.
  - @react-grab/cli@0.1.46