Expand all

CodeMirrorThemes

This class houses all logic involving themes. It adds the available themes as a dropdown in the preferences form and registers them in the extension registry.

Themes are forked from @fsegurai/codemirror-theme-bundle (MIT).

The constructor is internal. The class can be accessed via CodeMirror#themes.

Properties

docElement :HTMLElement #

The element, which is used to determine whether the skin is in dark mode.

Type:

Source:
The element, which is used to determine whether the skin is in dark mode.

editor :Editor|null #

The editor the theme is applied to, once one is available.

Type:

Source:
The editor the theme is applied to, once one is available.

isDark :boolean #

Whether the skin is in dark mode.

Type:

  • boolean
Source:
Whether the skin is in dark mode.

matchMediaQuery :MediaQueryList #

A MediaQueryList that matches if the user has set their OS-level color scheme preference to dark.

Type:

Source:

A MediaQueryList that matches if the user has set their OS-level color scheme preference to dark.

preferredTheme :PrefValue #

The user's preferred theme, as stored in the preferences.

Type:

Source:
The user's preferred theme, as stored in the preferences.

themes :Map.<string, Extension> #

Mapping of available themes and their Extensions.

Type:

Source:
Mapping of available themes and their Extensions.

themeFacet :Facetstatic #

The name of the applied theme, as CodeMirrorThemes#setLightOrDarkMode adds it to the theme's Extension. A theme is otherwise a set of styles, which say nothing to an integration that renders no CodeMirror of its own.

Type:

Source:

The name of the applied theme, as CodeMirrorThemes#setLightOrDarkMode adds it to the theme's Extension.

Methods

destroy() #

Stop watching for dark mode changes.

Source:
Stop watching for dark mode changes.