ColorModeAware

@Composable
fun ColorModeAware(element: HTMLElement = document.documentElement.unsafeCast<HTMLElement>())(source)

Set the CSS class representing the active color mode on element. This will enable color mode aware styles for all descendants of element and set the necessary CSS variables for Silk widgets, if being used.

Parameters

element

An element which must live at a point in the DOM tree at or above the app root. By default, this will be the DOM root.


@Composable
fun ColorModeAware(elementId: String)(source)

Set the CSS class representing the active color mode on the element with the target ID. This will enable color mode aware styles for all the element's descendants and set the necessary CSS variables for Silk widgets, if being used.