Dark theme support

You can add different icons for light and dark themes.

Usually we pass an image encoded as base64 to img. This can also be an absolute image URL. But we can also pass an object, that contains two images with the keys LIGHT and DARK for light and dark themes respectively.

1this.adapter.attachConfig({
2 POST: () =>
3 button({
4 DEFAULT: {
5 label: 'Injected Button',
6 img: {
7 LIGHT: LIGHT_IMG,
8 DARK: DARK_IMG,
9 },
10 exec: () => Core.alert('Hello, Themes!'),
11 },
12 }),
13})

The complete code for this example can be found here: ex12-dark-theme-support.

video