Skip to content

BlockSuite API Documentation / @blocksuite/blocks / ThemeObserver

Class: ThemeObserver

Observer theme changing by data-theme property

Extends

  • Slot<CssVariablesMap>

Constructors

new ThemeObserver(undefined)

new ThemeObserver(): ThemeObserver

Returns

ThemeObserver

Inherited from

Slot.constructor

Properties

_cssVariables

private _cssVariables: null | CssVariablesMap = null

Source

packages/blocks/src/_common/theme/theme-observer.ts:29


_mode

private _mode: string = ''

Source

packages/blocks/src/_common/theme/theme-observer.ts:28


_observer?

private optional _observer: MutationObserver

Source

packages/blocks/src/_common/theme/theme-observer.ts:26


subscribe

subscribe: <U>(selector, callback, config?) => Disposable

Type parameters

U

Parameters

selector

callback

config?

config.equalityFn?

config.filter?

Returns

Disposable

Inherited from

Slot.subscribe

Source

packages/framework/global/dist/utils/slot.d.ts:8

Accessors

cssVariables

get cssVariables(): null | CssVariablesMap

Returns

null | CssVariablesMap

Source

packages/blocks/src/_common/theme/theme-observer.ts:31

Methods

dispose()

dispose(): void

Returns

void

Overrides

Slot.dispose

Source

packages/blocks/src/_common/theme/theme-observer.ts:65


emit()

emit(v): void

Parameters

v: CssVariablesMap

Returns

void

Inherited from

Slot.emit

Source

packages/framework/global/dist/utils/slot.d.ts:14


filter()

filter(testFun): Slot<CssVariablesMap>

Parameters

testFun

Returns

Slot<CssVariablesMap>

Inherited from

Slot.filter

Source

packages/framework/global/dist/utils/slot.d.ts:6


getVariableValue()

getVariableValue(variable): string

Parameters

variable: string

Returns

string

Source

packages/blocks/src/_common/theme/theme-observer.ts:51


observe()

observe(element): void

Parameters

element: HTMLElement

Returns

void

Source

packages/blocks/src/_common/theme/theme-observer.ts:35


on()

on(callback): Disposable

Parameters

callback

Returns

Disposable

Inherited from

Slot.on

Source

packages/framework/global/dist/utils/slot.d.ts:7


once()

once(callback): Disposable

Parameters

callback

Returns

Disposable

Inherited from

Slot.once

Source

packages/framework/global/dist/utils/slot.d.ts:12


pipe()

pipe(that): Slot<CssVariablesMap>

Parameters

that: Slot<CssVariablesMap>

Returns

Slot<CssVariablesMap>

Inherited from

Slot.pipe

Source

packages/framework/global/dist/utils/slot.d.ts:15


toDispose()

toDispose(disposables): Slot<CssVariablesMap>

Parameters

disposables: Disposable[]

Returns

Slot<CssVariablesMap>

Inherited from

Slot.toDispose

Source

packages/framework/global/dist/utils/slot.d.ts:17


unshift()

unshift(callback): Disposable

Parameters

callback

Returns

Disposable

Inherited from

Slot.unshift

Source

packages/framework/global/dist/utils/slot.d.ts:13