import cssText from './styles.css?inline' import type { Accessor } from 'solid-js' /** * Creates a function that adds the `-dark` modifier of a styles.css class in * the dark theme. * @param theme - The devtools theme. * @returns A function that takes a class name and returns the class names. */ export const createThemed = (theme: Accessor<'light' | 'dark'>) => (name: string) => theme() === 'dark' ? `${name} ${name}-dark` : name // One constructed stylesheet per document: a constructed stylesheet can only // be adopted by the document that created it and that document's shadow roots. const sheets = new WeakMap() /** * Adopts the devtools stylesheet where `el` renders: the given * `shadowDOMTarget`, else the shadow root that contains `el`, else the * document that owns `el`. Adopted stylesheets are not `