# Cascading Style Sheets

You can use a cascading style sheet (CSS) by add a `.css` file to a published folder and then passing it to the `-Stylesheets` parameter for `New-UDDashboard`.

For example, the `dashboard.ps1` file would look like this.

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


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

You could then setup a published folder to provide the assets route. This is what the contents of `publishedFolders.ps1` will look like.

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

Within the `C:\assets` folder, you can place any assets you'd like to access on the `/assets` route.

![Assets folder](/files/yNgawtlwbuKf9j1RE06d)

You can then create a style sheet to manipulate whatever portion of the dashboard you'd like.

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

This produces a dashboard with a background image of Austin the dog sleeping in a pile of dirt.

![](/files/ADp6I7JeMMWf9UN8xJ98)

## Determining the Correct Class Names

Every Material UI component has a series of global class names that you can use to apply styles throughout your dashboard. To determine the correct class names, you can view the a particular component's API documentation. There is a list of the global class names that apply to that component.

For example, here is the [CSS documentation for the Alert component](https://material-ui.com/api/alert/#css).

Within your CSS file, you can use these class names to override styles throughout your dashboard. If you wanted to set all success alerts to have a red background, you could create a CSS file like this.

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


---

# Agent Instructions: 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:

```
GET https://docs.powershelluniversal.com/apps/themes/cascading-style-sheets.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
