> 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/it/app/themes/cascading-style-sheets.md).

# Cascading Style Sheets

È possibile utilizzare un foglio di stile a cascata (CSS) aggiungendo un file `.css` a una cartella pubblicata e passandolo poi al parametro `-Stylesheets` di `New-UDDashboard`.

Ad esempio, il file `dashboard.ps1` avrebbe questo aspetto.

```powershell
New-UDDashboard -Title "Server Monitor" -Content {


} -Stylesheets @("/assets/theme.css")
```

Potrebbe quindi configurare una cartella pubblicata per fornire il percorso assets. Ecco come si presenterà il contenuto di `publishedFolders.ps1`.

```powershell
New-PSUPublishedFolder -RequestPath "/assets" -Path "C:\assets"
```

All'interno della cartella `C:\assets`, può inserire qualsiasi asset a cui desidera accedere tramite il percorso `/assets`.

![Cartella assets](/files/GPGgmEdvfyn2M9ag1Tlz)

Può quindi creare un foglio di stile per manipolare qualsiasi parte della dashboard desideri.

```css
.ud-dashboard > div {
    background-image: url("/assets/image.jpeg");
}
```

Questo produce una dashboard con un'immagine di sfondo del cane Austin che dorme in un mucchio di terra.

![](/files/s8oCAkgFzbcK7ZHB9ifS)

## Determinare i nomi di classe corretti

Ogni componente Material UI dispone di una serie di nomi di classe globali che è possibile utilizzare per applicare stili in tutta la dashboard. Per determinare i nomi di classe corretti, può consultare la documentazione API di un particolare componente. È presente un elenco dei nomi di classe globali applicabili a quel componente.

Ad esempio, ecco la [documentazione CSS per il componente Alert](https://material-ui.com/api/alert/#css).

All'interno del file CSS, può utilizzare questi nomi di classe per sovrascrivere gli stili in tutta la dashboard. Se volesse impostare uno sfondo rosso per tutti gli avvisi di tipo success, potrebbe creare un file CSS come questo.

```css
.MuiAlert-standardSuccess { background-color: red !important;  }
```


---

# 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/it/app/themes/cascading-style-sheets.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.
