fix: hydrate in twind-v1-plugin (#1050)
This commit is contained in:
+14
-2
@@ -1,5 +1,17 @@
|
||||
import { getSheet, setup, TwindConfig } from "https://esm.sh/@twind/core@1.1.3";
|
||||
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) {
|
||||
setup(options, getSheet());
|
||||
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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user