> 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

Aggiunga fogli di stile CSS personalizzati alle dashboard di PowerShell Universal tramite cartelle pubblicate e il parametro Stylesheets per sovrascrivere le classi di Material UI.

Può 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 presenta il contenuto di `publishedFolders.ps1`.

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

All'interno della cartella `C:\assets` può inserire tutte le risorse a cui desidera accedere sul percorso `/assets`.

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 di Austin, il cane che dorme in un mucchio di terra.

## Determinare i nomi corretti delle classi

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

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

All'interno del suo file CSS può utilizzare questi nomi di classi per sovrascrivere gli stili in tutta la dashboard. Se volesse impostare uno sfondo rosso per tutti gli avvisi di successo, 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.
