Skip to content
On this page

@bridge/theme

Module that allows you to access the current theme and react to when it changes.

Functions

getColor

getColor(name): string

Get the color code of the given color name, from the current theme.

Parameters

NameTypeDescription
nameTColorNameThe name of the color to get.

Returns

string


getCurrentMode

getCurrentMode(): "light" | "dark"

Gets the current theme mode.

Returns

"light" | "dark"


getHighlighterInfo

getHighlighterInfo(name): { background?: string ; color?: string ; isItalic?: boolean ; textDecoration?: string } | undefined

Get the highlighter info of a give color name.

Parameters

NameType
namestring

Returns

{ background?: string ; color?: string ; isItalic?: boolean ; textDecoration?: string } | undefined


onChange

onChange(func): IDisposable

Create a callback to be called when the given theme mode changes theme.

Parameters

NameType
func(mode: "dark" | "light") => void

Returns

IDisposable

Released under the GPL-3.0 License.