@atomico/hooks
Advanced tools
Comparing version 3.31.0 to 3.32.0
{ | ||
"name": "@atomico/hooks", | ||
"description": "Series of utilities in hooks format to extend the operation of Atomico", | ||
"version": "3.31.0", | ||
"version": "3.32.0", | ||
"type": "module", | ||
@@ -6,0 +6,0 @@ "workspaces": [ |
@@ -7,3 +7,3 @@ import { useHost, useLayoutEffect } from "atomico"; | ||
* Create a style collector to apply once the render is finished | ||
* @param {import("atomico").Sheet} sheet | ||
* @param {import("atomico").Sheets} sheet | ||
*/ | ||
@@ -24,6 +24,12 @@ export function useCssLightDom(sheet) { | ||
getRules( | ||
sheet, | ||
current.localName + `[data-sheet="${current.dataset.sheet}"]` | ||
).forEach((rule, index) => style.sheet.insertRule(rule, index)); | ||
(Array.isArray(sheet) ? sheet.flat(100) : [sheet]).forEach( | ||
(sheet) => | ||
sheet && | ||
getRules( | ||
sheet, | ||
current.localName + `[data-sheet="${current.dataset.sheet}"]` | ||
).forEach((rule) => | ||
style.sheet.insertRule(rule, style.sheet.cssRules.length) | ||
) | ||
); | ||
@@ -30,0 +36,0 @@ return () => style.remove(); |
/** | ||
* Create a style collector to apply once the render is finished | ||
* @param {import("atomico").Sheet} sheet | ||
* @param {import("atomico").Sheets} sheet | ||
*/ | ||
export function useCssLightDom(sheet: import("atomico").Sheet): void; | ||
export function useCssLightDom(sheet: import("atomico").Sheets): void; |
83516
2469