use-css-light-dom
share your style sheets between LightDOM and ShadowDOM
Module
import { useCssLightDom } from "@atomico/hooks/use-css-light-dom";Syntax
useCssLightDom(sheets: import("atomico").Sheets);Example
import { css } from "atomico";
import { useCssLightDom } from "@atomico/hooks/use-css-light-dom";
const sheet = css`
:host {
display: block;
background: black;
color: white;
padding: 100px;
border-radius: 1rem;
}
:host(:hover) {
background: crimson;
}
`;
function myExample() {
useCssLightDom(sheet);
return (
<host>
<h1>Hello</h1>
</host>
);
}Last updated
Was this helpful?
