Style
Edit this pageStyle adds a <style> element for CSS rules that apply to the document.
Import
import { Style } from "@solidjs/meta";Type
const Style: Component<JSX.StyleHTMLAttributes<HTMLStyleElement>>;Props
Accepts attributes for <style>.
children
- Type:
JSX.Element - Optional: Yes
Content rendered inside the style element.
Behavior
- Registers a
styletag withclose: true. - Non-cascading tags can add one document-head element per active instance.
- Requires
MetaProviderin the component tree.
Examples
Basic usage
import { MetaProvider, Style } from "@solidjs/meta";
export default function Root() { return ( <MetaProvider> <Style>{` p { color: #26b72b; } `}</Style> </MetaProvider> );}