setTheme()
setTheme({ colors: {...}} || { light: { colors: {...}}, dark: {colors: {..}} )
You must be using daily-js 0.16.0
or higher to use this method.
Sets theme colors for an active Daily Prebuilt call.
Colors must be in hex format, ex. "#286DA8
".
The theme can be set globally, regardless of OS light/dark mode.
Or you can provide both light
and dark
themes (both must be present or an error will be thrown).
Daily Prebuilt determines the color mode using the @media (prefers-color-scheme: dark | light)
media query.
This will apply the light or dark theme based on the user's browser or system settings.
It is possible to provide a subset of theme colors. For example, setting just a global accent color:
Or a few color overrides for both light
and dark
mode:
Returns a Promise which resolves with theme
properties that were set.