# SiThemeDomTarget Type documentation

## TypeScript declaration

### [SiThemeDomTarget](<https://github.com/siemens/element/blob/main/projects/element-ng/theme/si-theme-dom-target.ts#L13-L26>)

**Kind:** interface

```
import type { SiThemeDomTarget } from '@siemens/element-ng/theme';
```

DOM boundary controlled by [SiThemeService](<../../injectables/SiThemeService/index.html#SiThemeService>).

```
interface SiThemeDomTarget
```

#### Properties

| Name | Type | Description |
| --- | --- | --- |
| [element](<https://github.com/siemens/element/blob/main/projects/element-ng/theme/si-theme-dom-target.ts#L15-L15>) (readonly) | `HTMLElement` | Element that receives theme and color-scheme classes. |
| [eventTarget](<https://github.com/siemens/element/blob/main/projects/element-ng/theme/si-theme-dom-target.ts#L19-L19>) (optional, readonly) | `EventTarget` | Event target for the legacy `theme-switch` event. |
| [rootSelector](<https://github.com/siemens/element/blob/main/projects/element-ng/theme/si-theme-dom-target.ts#L17-L17>) (readonly) | `string` | CSS selector used for runtime theme variables. |

#### Methods

##### appendStyleElement

[Source for appendStyleElement](<https://github.com/siemens/element/blob/main/projects/element-ng/theme/si-theme-dom-target.ts#L24-L24>)

```
appendStyleElement(style: HTMLStyleElement): void
```

#### Parameters

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| [style](<https://github.com/siemens/element/blob/main/projects/element-ng/theme/si-theme-dom-target.ts#L24-L24>) | `HTMLStyleElement` |  |  |

**Returns:** [void](<https://www.typescriptlang.org/docs/handbook/2/functions.html#void>)

##### forEachElement

[Source for forEachElement](<https://github.com/siemens/element/blob/main/projects/element-ng/theme/si-theme-dom-target.ts#L21-L21>)

```
forEachElement(callback: (element: HTMLElement) => void): void
```

#### Parameters

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| [callback](<https://github.com/siemens/element/blob/main/projects/element-ng/theme/si-theme-dom-target.ts#L21-L21>) | `(element: HTMLElement) => void` |  |  |

**Returns:** [void](<https://www.typescriptlang.org/docs/handbook/2/functions.html#void>)

##### getStyleElement

[Source for getStyleElement](<https://github.com/siemens/element/blob/main/projects/element-ng/theme/si-theme-dom-target.ts#L23-L23>)

```
getStyleElement(id: string): HTMLStyleElement | null
```

#### Parameters

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| [id](<https://github.com/siemens/element/blob/main/projects/element-ng/theme/si-theme-dom-target.ts#L23-L23>) | `string` |  |  |

**Returns:** [HTMLStyleElement](<https://developer.mozilla.org/docs/Web/API/HTMLStyleElement>)`  |  `[null](<https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null>)

##### registerElement

[Source for registerElement](<https://github.com/siemens/element/blob/main/projects/element-ng/theme/si-theme-dom-target.ts#L22-L22>)

**Modifiers:** optional

```
registerElement(element: HTMLElement): () => void
```

#### Parameters

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| [element](<https://github.com/siemens/element/blob/main/projects/element-ng/theme/si-theme-dom-target.ts#L22-L22>) | `HTMLElement` |  |  |

**Returns:** `() => `[void](<https://www.typescriptlang.org/docs/handbook/2/functions.html#void>)

##### updateColorScheme

[Source for updateColorScheme](<https://github.com/siemens/element/blob/main/projects/element-ng/theme/si-theme-dom-target.ts#L25-L25>)

```
updateColorScheme(colorScheme: ColorScheme): void
```

#### Parameters

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| [colorScheme](<https://github.com/siemens/element/blob/main/projects/element-ng/theme/si-theme-dom-target.ts#L25-L25>) | `ColorScheme` |  |  |

**Returns:** [void](<https://www.typescriptlang.org/docs/handbook/2/functions.html#void>)

### Types Documentation

### [ColorScheme](<https://github.com/siemens/element/blob/main/projects/element-ng/theme/si-theme.model.ts#L52-L52>)

**Kind:** type alias

```
import type { ColorScheme } from '@siemens/element-ng/theme';
```

```
type ColorScheme = 'light' | 'dark'
```
