# Colors

Use color utility classes to convey meaning and enhance readability.

Apply color to text elements using the following classes:

```
<!-- Default Text Color -->
<div class="text-primary">default</div>

<!-- Text Color Classes -->
<hr />
<div class="text-secondary">text-secondary</div>
<div class="text-disabled">text-disabled</div>
<div class="text-accent">text-accent</div>

<!-- Inverse Color Classes -->
<hr />
<div class="text-inverse background-neutral">text-inverse</div>

<!-- Context Color Classes -->
<hr />
<div class="text-success">text-success</div>
<div class="text-warning">text-warning</div>
<div class="text-caution">text-caution</div>
<div class="text-information">text-information</div>
<div class="text-danger">text-danger</div>
```

#### Example

Component:

```typescript
/**
 * Copyright (c) Siemens 2016 - 2026
 * SPDX-License-Identifier: MIT
 */
import { Component } from '@angular/core';

@Component({
  selector: 'app-sample',
  templateUrl: './color-variants.html',
  host: { class: 'p-5' }
})
export class SampleComponent {}
```

Template:

```html
<h3 class="text-accent">text-accent</h3>
<h3 class="text-accent-active">text-accent-active</h3>
<h3 class="text-accent-hover">text-accent-hover</h3>
<h3 class="text-caution">text-caution</h3>
<h3 class="text-critical">text-critical</h3>
<h3 class="text-danger">text-danger</h3>
<h3 class="text-disabled" aria-disabled="true">text-disabled</h3>
<h3 class="text-information">text-information</h3>
<h3 class="text-inverse background-inverse px-2">text-inverse</h3>
<h3 class="text-on-accent background-accent px-2">text-on-accent</h3>
<h3 class="text-on-accent-secondary background-accent-secondary px-2">text-on-accent-secondary</h3>
<h3 class="text-on-accent-secondary-active background-accent-secondary-active px-2">
  text-on-accent-secondary-active
</h3>
<h3 class="text-on-accent-secondary-hover background-accent-secondary-hover px-2">
  text-on-accent-secondary-hover
</h3>
<h3 class="text-on-caution background-caution px-2">text-on-caution</h3>
<h3 class="text-on-critical background-critical px-2">text-on-critical</h3>
<h3 class="text-on-danger background-danger px-2">text-on-danger</h3>
<h3 class="text-on-danger-secondary background-danger-secondary px-2">text-on-danger-secondary</h3>
<h3 class="text-on-information background-information px-2">text-on-information</h3>
<h3 class="text-on-success background-success px-2">text-on-success</h3>
<h3 class="text-on-warning background-warning px-2">text-on-warning</h3>
<h3 class="text-on-warning-secondary background-warning-secondary px-2"
  >text-on-warning-secondary</h3
>
<h3 class="text-primary">text-primary</h3>
<h3 class="text-secondary">text-secondary</h3>
<h3 class="text-success">text-success</h3>
<h3 class="text-warning">text-warning</h3>
```

## Using SASS variables

For greater flexibility, apply color variants using SASS. We recommend using [semantic color tokens](<https://element.siemens.io/fundamentals/colors/ui-colors/>):

```
@use '@siemens/element-theme/src/styles/variables';

/* Pick the tokens you need: */
color: variables.$si-sys-color-text-primary;
background-color: variables.$si-sys-color-background-warning-subtle;
```

For a complete list of system and reference tokens, see the [@siemens-ux/design-tokens documentation](<https://code.siemens.com/ux/sdl>).
