Files
sweet/plugins/twindv1/main.ts
T

18 lines
448 B
TypeScript

import {
cssom,
getSheet,
setup,
TwindConfig,
} from "https://esm.sh/@twind/core@1.1.3";
import { STYLE_ELEMENT_ID } from "./shared.ts";
export default function hydrate(options: TwindConfig) {
const elem = document.getElementById(STYLE_ELEMENT_ID) as HTMLStyleElement;
const sheet = cssom(elem);
sheet.resume = getSheet().resume.bind(sheet);
document.querySelector('[data-twind="claimed"]')?.remove();
setup(options, sheet);
}