Skip to content

@bynary.composables.observer.Function.useColorScheme

github-actions[bot] edited this page Jul 11, 2024 · 3 revisions

@bynary/composables / @bynary/composables/observer / useColorScheme

Function: useColorScheme()

useColorScheme<CustomColorScheme>(options?): object

Type Parameters

CustomColorScheme extends ColorScheme = ColorScheme

Parameters

options?: IUseColorSchemeOptions<CustomColorScheme>

Options for the composable

Returns

object

A set of signals to handle the color scheme

  • preferred: The preferred color scheme of the user based on the browser settings
  • store: A signal to override the preferred color scheme
  • resolved: The resolved color scheme, based on the preferred color scheme and the override. The override will be used if defined, otherwise the preferred color scheme.

preferred

preferred: Signal<null | ColorScheme>

resolved

resolved: Signal<null | ColorScheme>

store

store: WritableSignal<null | CustomColorScheme>

Defined in

observer/src/color-scheme.composable.ts:112

Clone this wiki locally