The inline script that preloads the hero's twin for the page's scheme, from the <head>, so the browser fetches that twin once. It reads the dark class colorSchemeScript sets, picks that twin, and adds one <link rel="preload"> for exactly the source its <picture> will use: the first sources entry whose media matches, or else the twin's own srcSet and sizes. Use one twin's priority instead when most visitors see the same scheme, with no helper.
import { heroPreloadScript } from "@/lib/ouro/hero-preload-script";Example
<html lang="en" suppressHydrationWarning>
<head>
<script dangerouslySetInnerHTML={{ __html: colorSchemeScript() + heroPreloadScript({ light, dark }) }} />
</head>
<body>{children}</body>
</html>Parameters
pictures- Type:
HeroPreloadPictures
Returns
string

