> For the complete documentation index, see [llms.txt](https://docs.devolutions.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.devolutions.net/powershell-universal/de/apps/themes/styles.md).

# Stile

Sie können Stile auf einzelne Komponenten innerhalb von Apps anwenden, indem Sie die Komponente `UDStyle` verwenden. Diese Komponente muss zu Ihrem Dashboard hinzugefügt werden und ist Teil der Kernkomponenten, die in PowerShell Universal enthalten sind.

## Einen Stil anwenden

Um einen Stil auf eine Komponente oder eine Reihe von Komponenten anzuwenden, rufen Sie das Cmdlet `New-UDStyle` auf, geben einen CSS-Stil an und fügen dann die Komponenten, die Sie gestalten möchten, innerhalb des Skriptblocks `-Content` ein.

```powershell
New-UDStyle -Style '
    padding: 32px;
    background-color: hotpink;
    font-size: 24px;
    border-radius: 4px;
    &:hover {
      color: white;
    }
    .MuiCardHeader-root {
        background-color: green !important;   
    }
    .MuiCardContent-root {
        background-color: green !important;   
    }' -Content {
        New-UDCard -Title 'Test' -Content {
            "Hello"
        }
    }
```

![UDStyled card](/files/xJggcicj3769v80f3UqZ)

## Integrierte Stile überschreiben

Jede Material UI-Komponente verfügt über eine Reihe integrierter Klassen, die Sie mit `New-UDStyle` überschreiben können. Um die Klassennamen zu bestimmen, die Sie überschreiben müssen, können Sie die API-Dokumentation für die Komponente, die Sie ändern möchten, auf der Material UI-Website einsehen. Hier ist zum Beispiel eine Auflistung der CSS-[Klassennamen](https://material-ui.com/api/alert/#css) der Alert-Komponente.

Wenn Sie eine Erfolgsmeldung (success alert) verwenden, wird die Klasse `.MuiAlert-standardSuccess` auf Ihre Komponente angewendet. Sie können diesen Standardstil wie folgt überschreiben.

```powershell
New-UDStyle -Style '.MuiAlert-standardSuccess { background-color: red !important;  }  ' -Content {
    New-UDAlert -Text "Hello"
}
```

Die resultierende Meldung wird rot statt des standardmäßigen Grüns sein.

![Alert with Red Background](/files/xBV2ahSYoYQdvTzPtf4v)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.devolutions.net/powershell-universal/de/apps/themes/styles.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
