diff --git a/.github/workflows/vizro-qa-tests-trigger.yml b/.github/workflows/vizro-qa-tests-trigger.yml
index da3c86793..4e1bf450d 100644
--- a/.github/workflows/vizro-qa-tests-trigger.yml
+++ b/.github/workflows/vizro-qa-tests-trigger.yml
@@ -42,8 +42,8 @@ jobs:
- uses: actions/checkout@v4
- name: Tests trigger
run: |
- export INPUT_OWNER=${{ secrets.VIZRO_QA_ORG }}
- export INPUT_REPO=${{ secrets.VIZRO_QA_REPO }}
+ export INPUT_OWNER=mckinsey
+ export INPUT_REPO=vizro-qa
if [ "${{ matrix.label }}" == "integration tests" ]; then
export INPUT_WORKFLOW_FILE_NAME=${{ secrets.VIZRO_QA_INTEGRATION_TESTS_WORKFLOW }}
elif [ "${{ matrix.label }}" == "notebooks test" ]; then
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 96cbd803b..eb11a399a 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -109,6 +109,11 @@ repos:
hooks:
- id: vale
args: [--config=.vale/.vale.ini]
+ # There's no way to automatically convert vale suggestions/warnings to errors, and so they won't appear at all unless
+ # there's an error raised.
+ # pre-commit's verbose mode means that suggestions and warnings are always shown even if there's no error raised.
+ # See https://github.com/errata-ai/vale/issues/575.
+ verbose: true
# Configuration for https://pre-commit.ci/.
ci:
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index a92781344..a04f47172 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -3,4 +3,4 @@
Contributions of all experience levels are welcome! If you're interested in making a contribution,
please refer to our [Contributing Guide](https://vizro.readthedocs.io/en/stable/pages/explanation/contributing/) for more information.
-The easiest way to get up and running is to [open the repository in GitHub Codespaces](https://github.com/codespaces/new?hide_repo_select=true&ref=main&repo=626855142). This will create a temporary development environment with all the necessary configurations, making it especially convenient for tasks like reviewing pull requests.
+The easiest way to get up and running is to [open the repository in GitHub Codespaces](https://github.com/codespaces/new?hide_repo_select=true&ref=main&repo=626855142). This creates a temporary development environment with all the necessary configurations, making it especially convenient for tasks like reviewing pull requests.
diff --git a/README.md b/README.md
index 10ae2d018..ea0ad69a3 100644
--- a/README.md
+++ b/README.md
@@ -106,7 +106,7 @@ You can see Vizro in action by clicking on the following image or by visiting [t
-## Vizro visual vocabulary
+## Visual vocabulary
Our visual vocabulary dashboard helps you to select and create various types of charts. It helps you decide when to use
each chart type, and offers sample Python code to create these charts with [Plotly](https://plotly.com/python/) and
diff --git a/pyproject.toml b/pyproject.toml
index bf7f977bb..7d81efea6 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -95,4 +95,4 @@ select = [
"vizro-ai/examples/chart_by_vizro_ai.ipynb" = ["T201", "E501"]
"vizro-ai/examples/dashboard_by_vizro_ai.ipynb" = ["T201", "E402", "E501"]
# Ignore missing docstrings in visual-vocabulary examples to keep them succinct.
-"vizro-core/examples/_visual-vocabulary/pages/examples/**" = ["D100", "D103"]
+"vizro-core/examples/visual-vocabulary/pages/examples/**" = ["D100", "D103"]
diff --git a/vizro-ai/changelog.d/20240918_175213_huong_li_nguyen_add_visual_formatting_guide.md b/vizro-ai/changelog.d/20240918_175213_huong_li_nguyen_add_visual_formatting_guide.md
new file mode 100644
index 000000000..f1f65e73c
--- /dev/null
+++ b/vizro-ai/changelog.d/20240918_175213_huong_li_nguyen_add_visual_formatting_guide.md
@@ -0,0 +1,48 @@
+
+
+
+
+
+
+
+
+
diff --git a/vizro-ai/changelog.d/20240923_113307_huong_li_nguyen.md b/vizro-ai/changelog.d/20240923_113307_huong_li_nguyen.md
new file mode 100644
index 000000000..f1f65e73c
--- /dev/null
+++ b/vizro-ai/changelog.d/20240923_113307_huong_li_nguyen.md
@@ -0,0 +1,48 @@
+
+
+
+
+
+
+
+
+
diff --git a/vizro-ai/docs/pages/user-guides/retrieve-dashboard-code.md b/vizro-ai/docs/pages/user-guides/retrieve-dashboard-code.md
index 7ae1c7a61..b0edab548 100644
--- a/vizro-ai/docs/pages/user-guides/retrieve-dashboard-code.md
+++ b/vizro-ai/docs/pages/user-guides/retrieve-dashboard-code.md
@@ -33,7 +33,7 @@ from vizro_ai import VizroAI
vizro_ai = VizroAI(model="gpt-4o-mini")
result = vizro_ai.dashboard([df], user_question, return_elements=True)
```
-This will trigger the dashboard building process. Once Vizro-AI finishes the dashboard generation process, you can now launch the dashboard.
+This triggers the dashboard building process. Once Vizro-AI finishes the dashboard generation process, you can now launch the dashboard.
!!! example "Generated dashboard"
diff --git a/vizro-ai/hatch.toml b/vizro-ai/hatch.toml
index 1588b45ee..866731f22 100644
--- a/vizro-ai/hatch.toml
+++ b/vizro-ai/hatch.toml
@@ -61,7 +61,7 @@ dependencies = [
"pip",
"mkdocs>=1.6",
"mkdocs-material",
- "mkdocs-git-revision-date-localized-plugin",
+ "mkdocs-git-revision-date-localized-plugin>=1.2.5",
"mkdocstrings[python]",
"linkchecker"
]
diff --git a/vizro-core/CHANGELOG.md b/vizro-core/CHANGELOG.md
index dfaf835c9..6d9fe8b61 100644
--- a/vizro-core/CHANGELOG.md
+++ b/vizro-core/CHANGELOG.md
@@ -149,7 +149,7 @@ See the fragment files in the [changelog.d directory](https://github.com/mckinse
## Removed
-- Remove all CSS classes with suffix `_outer` from components. Visit the user guide on [how to customize CSS in selected components](https://vizro.readthedocs.io/en/stable/pages/user-guides/assets/#overwrite-css-properties-in-selective-components) for more details. ([#456](https://github.com/mckinsey/vizro/pull/456))
+- Remove all CSS classes with suffix `_outer` from components. Visit the user guide on [how to customize CSS in selected components](https://vizro.readthedocs.io/en/stable/pages/user-guides/custom-css/#overwrite-css-for-selected-components) for more details. ([#456](https://github.com/mckinsey/vizro/pull/456))
## Changed
diff --git a/vizro-core/README.md b/vizro-core/README.md
index 97d667ac6..859cb686b 100644
--- a/vizro-core/README.md
+++ b/vizro-core/README.md
@@ -98,7 +98,7 @@ You can see Vizro in action by clicking on the following image or by visiting [t
-## Vizro visual vocabulary
+## Visual vocabulary
Our visual vocabulary dashboard helps you to select and create various types of charts. It helps you decide when to use
each chart type, and offers sample Python code to create these charts with [Plotly](https://plotly.com/python/) and
diff --git a/vizro-core/changelog.d/20240918_135815_huong_li_nguyen_add_visual_formatting_guide.md b/vizro-core/changelog.d/20240918_135815_huong_li_nguyen_add_visual_formatting_guide.md
new file mode 100644
index 000000000..f1f65e73c
--- /dev/null
+++ b/vizro-core/changelog.d/20240918_135815_huong_li_nguyen_add_visual_formatting_guide.md
@@ -0,0 +1,48 @@
+
+
+
+
+
+
+
+
+
diff --git a/vizro-core/changelog.d/20240923_095658_huong_li_nguyen_fix_typo_and_folder_name.md b/vizro-core/changelog.d/20240923_095658_huong_li_nguyen_fix_typo_and_folder_name.md
new file mode 100644
index 000000000..f1f65e73c
--- /dev/null
+++ b/vizro-core/changelog.d/20240923_095658_huong_li_nguyen_fix_typo_and_folder_name.md
@@ -0,0 +1,48 @@
+
+
+
+
+
+
+
+
+
diff --git a/vizro-core/changelog.d/20240923_113256_huong_li_nguyen.md b/vizro-core/changelog.d/20240923_113256_huong_li_nguyen.md
new file mode 100644
index 000000000..f1f65e73c
--- /dev/null
+++ b/vizro-core/changelog.d/20240923_113256_huong_li_nguyen.md
@@ -0,0 +1,48 @@
+
+
+
+
+
+
+
+
+
diff --git a/vizro-core/changelog.d/20240923_132109_huong_li_nguyen_demo_last_changes.md b/vizro-core/changelog.d/20240923_132109_huong_li_nguyen_demo_last_changes.md
new file mode 100644
index 000000000..f1f65e73c
--- /dev/null
+++ b/vizro-core/changelog.d/20240923_132109_huong_li_nguyen_demo_last_changes.md
@@ -0,0 +1,48 @@
+
+
+
+
+
+
+
+
+
diff --git a/vizro-core/docs/assets/user_guides/custom_css/font-change.png b/vizro-core/docs/assets/user_guides/custom_css/font-change.png
new file mode 100644
index 000000000..c99ba33e6
Binary files /dev/null and b/vizro-core/docs/assets/user_guides/custom_css/font-change.png differ
diff --git a/vizro-core/docs/assets/user_guides/custom_css/highlighted-element.png b/vizro-core/docs/assets/user_guides/custom_css/highlighted-element.png
new file mode 100644
index 000000000..0a9794943
Binary files /dev/null and b/vizro-core/docs/assets/user_guides/custom_css/highlighted-element.png differ
diff --git a/vizro-core/docs/assets/user_guides/custom_css/inspect-icon.png b/vizro-core/docs/assets/user_guides/custom_css/inspect-icon.png
new file mode 100644
index 000000000..2572cd1c5
Binary files /dev/null and b/vizro-core/docs/assets/user_guides/custom_css/inspect-icon.png differ
diff --git a/vizro-core/docs/assets/user_guides/custom_css/inspect-panel.png b/vizro-core/docs/assets/user_guides/custom_css/inspect-panel.png
new file mode 100644
index 000000000..b60b7569f
Binary files /dev/null and b/vizro-core/docs/assets/user_guides/custom_css/inspect-panel.png differ
diff --git a/vizro-core/docs/assets/user_guides/custom_css/logo-position.png b/vizro-core/docs/assets/user_guides/custom_css/logo-position.png
new file mode 100644
index 000000000..ae626ba39
Binary files /dev/null and b/vizro-core/docs/assets/user_guides/custom_css/logo-position.png differ
diff --git a/vizro-core/docs/assets/user_guides/custom_css/style-container.png b/vizro-core/docs/assets/user_guides/custom_css/style-container.png
new file mode 100644
index 000000000..1327ddde3
Binary files /dev/null and b/vizro-core/docs/assets/user_guides/custom_css/style-container.png differ
diff --git a/vizro-core/docs/assets/user_guides/custom_css/temporary-changes.png b/vizro-core/docs/assets/user_guides/custom_css/temporary-changes.png
new file mode 100644
index 000000000..bb717db8c
Binary files /dev/null and b/vizro-core/docs/assets/user_guides/custom_css/temporary-changes.png differ
diff --git a/vizro-core/docs/assets/user_guides/custom_css/transparent-charts.png b/vizro-core/docs/assets/user_guides/custom_css/transparent-charts.png
new file mode 100644
index 000000000..a4d07c9f3
Binary files /dev/null and b/vizro-core/docs/assets/user_guides/custom_css/transparent-charts.png differ
diff --git a/vizro-core/docs/pages/explanation/contributing.md b/vizro-core/docs/pages/explanation/contributing.md
index 16598c324..c3617b92f 100644
--- a/vizro-core/docs/pages/explanation/contributing.md
+++ b/vizro-core/docs/pages/explanation/contributing.md
@@ -18,7 +18,7 @@ If you are already active on the Plotly Community Forum, you can also ask your q
## How to interact with the repository
-The easiest way to get up and running is to [open the repository in GitHub Codespaces](https://github.com/codespaces/new?hide_repo_select=true&ref=main&repo=626855142). This will create a temporary development environment with all the necessary configurations, making it especially convenient for tasks like reviewing pull requests.
+The easiest way to get up and running is to [open the repository in GitHub Codespaces](https://github.com/codespaces/new?hide_repo_select=true&ref=main&repo=626855142). This creates a temporary development environment with all the necessary configurations, making it especially convenient for tasks like reviewing pull requests.
We use [Hatch](https://hatch.pypa.io/) as a project management tool. To get started on your own machine, you should complete the following steps. Note there is _no need to set up your own virtual environment_ since Hatch takes care of that for you.
diff --git a/vizro-core/docs/pages/user-guides/assets.md b/vizro-core/docs/pages/user-guides/assets.md
index 77aa92cf1..53e9b9286 100644
--- a/vizro-core/docs/pages/user-guides/assets.md
+++ b/vizro-core/docs/pages/user-guides/assets.md
@@ -25,11 +25,20 @@ The user's `assets` folder thus always takes precedence.
Note that Vizro is currently not compatible with [Dash Bootstrap Themes](https://dash-bootstrap-components.opensource.faculty.ai/docs/themes/).
Adding a Bootstrap stylesheet will have no visual effect on the [components](https://vizro.readthedocs.io/en/stable/pages/user_guides/components/) included in Vizro.
+
## Change the favicon
To change the default favicon (website icon appearing in the browser tab), add a file named `favicon.ico` to your `assets` folder.
For more information, see the [Dash documentation](https://dash.plotly.com/external-resources#changing-the-favicon).
+## Add a logo image
+
+Vizro automatically incorporates the dashboard logo in the top-left corner of each page if an image named
+`logo.` is present within the assets folder.
+
+Image types of `apng`, `avif`, `gif`, `jpeg`, `jpg`, `png`, `svg`, and `webp` are supported.
+
+
## Change the `assets` folder path
If you do not want to place your `assets` folder in the root directory of your app, you can
specify an alternative path through the `assets_folder` argument of the [`Vizro`][vizro.Vizro] class.
@@ -57,221 +66,6 @@ clients. To include an image in the preview, place an image file in the assets f
Image types of `apng`, `avif`, `gif`, `jpeg`, `jpg`, `png`, `svg`, and `webp` are supported.
-## Add a logo image
-
-Vizro will automatically incorporate the dashboard logo in the top-left corner of each page if an image named `logo.` is present within the assets folder.
-
-Image types of `apng`, `avif`, `gif`, `jpeg`, `jpg`, `png`, `svg`, and `webp` are supported.
-
-
-## Overwrite global CSS properties
-To overwrite any global CSS properties of existing components, target the right CSS property and place your CSS files in the `assets` folder. This will overwrite any existing defaults for that CSS property.
-For reference, see the [Vizro CSS files](https://github.com/mckinsey/vizro/tree/main/vizro-core/src/vizro/static/css).
-
-!!! example "Customizing global CSS properties"
- === "my_css_file.css"
- ```css
- h1, h2 {
- color: hotpink;
- }
- ```
- === "app.py"
- ```py
- import os
- import vizro.models as vm
- from vizro import Vizro
-
- page = vm.Page(
- title="Changing the header color",
- components=[
- vm.Card(
- text="""
-
- # This is an
tag
-
- ## This is an
tag
-
- ###### This is an
tag
- """)
- ],
- )
-
- dashboard = vm.Dashboard(pages=[page])
-
-
- Vizro().build(dashboard).run()
- ```
-
- Run and edit this code in Py.Cafe
-
- === "app.yaml"
- ```yaml
- # Still requires a .py to add data to the data manager and parse YAML configuration
- # See yaml_version example
- pages:
- - components:
- - text: |
- # This is an
tag
-
- ## This is an
tag
-
- ###### This is an
tag
- type: card
- title: Changing the header color
- ```
- === "Result"
- [![AssetsCSS]][AssetsCSS]
-
- [AssetsCSS]: ../../assets/user_guides/assets/css_change.png
-
-
-## Overwrite CSS properties for specific pages
-To style components for a specific page, use the page's `id` in CSS selectors. By default, this is the [same as the page `title`](pages.md), but such a value might not be a valid CSS identifier.
-A suitable `id` must be unique across all models in the dashboard and should contain only alphanumeric characters, hyphens (`-`) and underscores (`_`). In particular, note that spaces are _not_ allowed.
-
-Suppose you want to hide the page title on one page only. Here's how you can achieve this:
-
-1. Give a valid `id` to the `Page`, for example `Page(id="page-with-hidden-title", title="Page with hidden title", ...)`.
-2. Identify the CSS class or CSS `id` you need to target. To hide the page title, you need to hide the container with the `id `right-header`.
-3. Use the `id` in combination with CSS selectors to change the relevant CSS properties.
-4. Add your custom css file to the `assets` folder as explained above.
-
-
-!!! example "Hide page title on selected pages"
- === "my_css_file.css"
- ```css
- #page-with-hidden-title #right-header {
- display: none;
- }
- ```
- === "app.py"
- ```py
- import vizro.models as vm
- from vizro import Vizro
-
- page_one = vm.Page(
- id="page-with-hidden-title",
- title="Page with hidden title",
- components=[vm.Card(text="""# Placeholder""")]
- )
-
- page_two = vm.Page(
- title="Page with shown title",
- components=[vm.Card(text="""# Placeholder""")]
- )
-
- dashboard = vm.Dashboard(pages=[page_one, page_two])
- Vizro().build(dashboard).run()
- ```
-
- Run and edit this code in Py.Cafe
-
- === "app.yaml"
- ```yaml
- # Still requires a .py to add data to the data manager and parse YAML configuration
- # See yaml_version example
- pages:
- - components:
- - text: |
- # Placeholder
- type: card
- title: Page with hidden title
- id: page-with-hidden-title
- - components:
- - text: |
- # Placeholder
- type: card
- title: Page with shown title
- ```
- === "Result"
- [![PageTitle]][PageTitle]
-
- [PageTitle]: ../../assets/user_guides/assets/css_page_title.png
-
-
-## Overwrite CSS properties in selective components
-To adjust CSS properties for specific components, like altering the appearance of a selected [`Card`][vizro.models.Card] rather than all `Card`s,
-you need to use a CSS selector that targets the right CSS property.
-If you're unfamiliar with CSS selectors, you can refer to this [tutorial](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_selectors/Selector_structure) for guidance.
-
-Let's say we want to change the background and font-color of a specific `Card`.
-
-Here's how you can do it:
-
-1. Assign a unique `id` to the relevant `Card`, for example: `Card(id="custom-card", ...)`
-2. Run your dashboard and open it in your browser
-3. View the HTML source to find the appropriate CSS class or element you need to target. For example, if you inspect a page with [Chrome DevTools](https://developer.chrome.com/docs/devtools/) then you can [directly copy the CSS selector](https://stackoverflow.com/questions/4500572/how-can-i-get-the-css-selector-in-chrome).
-
-It's essential to understand the relationship between the targeted CSS class or element and the component assigned the `id`, for example:
-
-
-```html title="HTML structure of a `Card`"
-
-
-
Lorem ipsum dolor sit amet consectetur adipisicing elit.
-
-
-```
-
-
-* **Main element with `id`:** There is a `
` with our `id="custom-card"`.
-* **Parent element:** That `
` is wrapped inside a parent `
` with the class name `"card"`. This is the element we need to target to change the background color.
-* **Child element:** The card text is wrapped inside a `
` that is a child of the `
` with our `id`. This is the element we need to target to change the font color.
-
-
-!!! example "Customizing CSS properties in selective components"
- === "my_css_file.css"
- ```css
- /* Apply styling to parent */
- .card:has(#custom-card) {
- background-color: white;
- }
-
- /* Apply styling to child */
- #custom-card p {
- color: black;
- }
- ```
- === "app.py"
- ```py
- import vizro.models as vm
- from vizro import Vizro
-
- page = vm.Page(
- title="Changing the card color",
- components=[
- vm.Card(id="custom-card", text="""Lorem ipsum dolor sit amet consectetur adipisicing elit."""),
- vm.Card(text="""Lorem ipsum dolor sit amet consectetur adipisicing elit.""")
- ],
- )
-
- dashboard = vm.Dashboard(pages=[page])
-
- Vizro().build(dashboard).run()
- ```
-
- Run and edit this code in Py.Cafe
-
- === "app.yaml"
- ```yaml
- # Still requires a .py to add data to the data manager and parse YAML configuration
- # See yaml_version example
- pages:
- - components:
- - text: |
- Lorem ipsum dolor sit amet consectetur adipisicing elit.
- type: card
- id: custom-card
- - text: |
- Lorem ipsum dolor sit amet consectetur adipisicing elit.
- type: card
- title: Changing the card color
- ```
- === "Result"
- [![CardCSS]][CardCSS]
-
- [CardCSS]: ../../assets/user_guides/assets/css_change_card.png
-
## Order of serving CSS files
diff --git a/vizro-core/docs/pages/user-guides/custom-css.md b/vizro-core/docs/pages/user-guides/custom-css.md
new file mode 100755
index 000000000..a34f0e0b7
--- /dev/null
+++ b/vizro-core/docs/pages/user-guides/custom-css.md
@@ -0,0 +1,477 @@
+# Customizing Vizro dashboard CSS
+
+Vizro is opinionated about visual formatting, and some elements, such as the layout of the navigation and components,
+are fixed. You can customize some settings such as background colors, fonts, and other styles via CSS overrides.
+
+To make customizations, you need to:
+
+1. **Add a CSS file to your `assets` folder**. Refer to our user guide on [adding static assets](assets.md#how-to-add-static-assets).
+2. **Identify the correct CSS selector** for the component you want to style.
+3. **Change the relevant CSS properties** in your CSS file.
+
+
+
+## Introduction to Vizro CSS
+For a short introduction to CSS, we recommend reading this article: [Get Started with CSS in 5 Minutes](https://www.freecodecamp.org/news/get-started-with-css-in-5-minutes-e0804813fc3e/).
+
+For a more comprehensive tutorial, refer to the [W3Schools CSS tutorial](https://www.w3schools.com/css/default.asp).
+The entire tutorial is beneficial, but the section on [CSS selectors](https://www.w3schools.com/css/css_selectors.asp)
+will be particularly useful.
+
+In Vizro, the CSS file is read in as an external stylesheet. The most common way of applying any styling to
+Vizro is therefore through the use of CSS selectors:
+
+- **Element Selector**: Applies the style to all elements inside the Vizro app.
+
+ ```
+ h1 {
+ font-size: 20px;
+ }
+
+ p {
+ color: green;
+ }
+ ```
+
+- **Class selector:** Targets all elements with the given class for styling. All CSS classes must be preceded with a
+`.` symbol.
+
+ ```
+ .card {
+ background: lightblue;
+ }
+ ```
+
+- **ID selector:** Targets the element with the given ID for styling. All CSS IDs must be preceded by a `#` symbol.
+
+ ```
+ #my-card {
+ background: lightblue;
+ }
+ ```
+
+
+## Identify the correct CSS selector
+
+Use Chrome DevTools or a similar tool (Web Inspector, Web Developer Tools, etc.) to inspect the HTML document in your browser.
+
+1. **Open DevTools:** In Google Chrome, right-click on the app and select "Inspect" from the context menu. This opens the
+HTML document of your Vizro app.
+
+ ![Inspect panel](../../assets/user_guides/custom_css/inspect-panel.png)
+
+
+2. **Select an element:** Suppose you want to change the background color of your cards. Click the
+"Select an element in the page to inspect it" icon in the top left corner of the inspect panel.
+
+ ![Inspect icon](../../assets/user_guides/custom_css/inspect-icon.png)
+
+3. **Find the HTML Block:** Hover over the component you want to style. The corresponding HTML block will be
+highlighted in the HTML document.
+
+ ![Highlighted element](../../assets/user_guides/custom_css/highlighted-element.png)
+
+ Notice that the selected HTML block corresponds to the container of the card and has a CSS class, here it is `card`.
+
+4. **Apply CSS:** Use this CSS class to style the card component. In your CSS file, you can write:
+
+ ```
+ .card {
+ background-color: blue;
+ }
+ ```
+
+ This changes the background color for any HTML element with the `card` class.
+
+**Tip:** You can also test your CSS live by editing the CSS attributes in the "Elements" panel.
+For example, temporarily add `background: blue;`. Note that this change will be lost upon reloading the page.
+
+![Temporary changes](../../assets/user_guides/custom_css/temporary-changes.png)
+
+
+## CSS overwrites
+
+### Overwrite CSS globally
+To overwrite any global CSS property, you need to target the element selector and place your CSS file with the
+overwrites in the `assets` folder.
+
+!!! example "Overwrite CSS globally"
+ === "my_css_file.css"
+ ```css
+ h1, h2 {
+ color: hotpink;
+ }
+ ```
+ === "app.py"
+ ```py
+ import os
+ import vizro.models as vm
+ from vizro import Vizro
+
+ page = vm.Page(
+ title="Changing the header color",
+ components=[
+ vm.Card(
+ text="""
+
+ # This is an
tag
+
+ ## This is an
tag
+
+ ###### This is an
tag
+ """)
+ ],
+ )
+
+ dashboard = vm.Dashboard(pages=[page])
+ Vizro().build(dashboard).run()
+ ```
+
+ Run and edit this code in Py.Cafe
+
+ === "app.yaml"
+ ```yaml
+ # Still requires a .py to add data to the data manager and parse YAML configuration
+ # See yaml_version example
+ pages:
+ - components:
+ - text: |
+ # This is an
tag
+
+ ## This is an
tag
+
+ ###### This is an
tag
+ type: card
+ title: Changing the header color
+ ```
+ === "Result"
+ [![AssetsCSS]][AssetsCSS]
+
+ [AssetsCSS]: ../../assets/user_guides/assets/css_change.png
+
+
+### Overwrite CSS for selected pages
+To style components for a specific page, use the page's `id` in the CSS selectors. By default, this is the
+[same as the page `title`](pages.md), but such a value might not be a valid CSS identifier.
+
+A suitable `id` must be unique across all models in the dashboard and should contain only alphanumeric
+characters, hyphens (`-`) and underscores (`_`). In particular, note that spaces are _not_ allowed.
+
+Suppose you want to hide the page title on one page only. Here's how you can achieve this:
+
+1. Give a valid `id` to the `Page`, for example `Page(id="page-with-hidden-title", title="Page with hidden title", ...)`.
+2. Identify the CSS class or CSS `id` you need to target. To hide the page title, you need to hide the parent container with the id `right-header`.
+3. Use the `id` to hide the content.
+4. Add your custom css file to the `assets` folder.
+
+
+!!! example "Hide page title on selected pages"
+ === "my_css_file.css"
+ ```css
+ #page-with-hidden-title #right-header {
+ display: none;
+ }
+ ```
+ === "app.py"
+ ```py
+ import vizro.models as vm
+ from vizro import Vizro
+
+ page_one = vm.Page(
+ id="page-with-hidden-title",
+ title="Page with hidden title",
+ components=[vm.Card(text="""# Placeholder""")]
+ )
+
+ page_two = vm.Page(
+ title="Page with shown title",
+ components=[vm.Card(text="""# Placeholder""")]
+ )
+
+ dashboard = vm.Dashboard(pages=[page_one, page_two])
+ Vizro().build(dashboard).run()
+ ```
+
+ Run and edit this code in Py.Cafe
+
+ === "app.yaml"
+ ```yaml
+ # Still requires a .py to add data to the data manager and parse YAML configuration
+ # See yaml_version example
+ pages:
+ - components:
+ - text: |
+ # Placeholder
+ type: card
+ title: Page with hidden title
+ id: page-with-hidden-title
+ - components:
+ - text: |
+ # Placeholder
+ type: card
+ title: Page with shown title
+ ```
+ === "Result"
+ [![PageTitle]][PageTitle]
+
+ [PageTitle]: ../../assets/user_guides/assets/css_page_title.png
+
+
+### Overwrite CSS for selected components
+To adjust CSS properties for specific components, like altering the appearance of a selected [`Card`][vizro.models.Card] rather than all Cards,
+you need to provide an `id` to the component you want to style.
+
+Let's say we want to change the `background-color` and `color` of a specific `Card`.
+
+Here's how you can do it:
+
+1. Assign a unique `id` to the relevant `Card`, for example: `Card(id="custom-card", ...)`
+2. Run your dashboard and open it in your browser
+3. View the HTML document to find the appropriate CSS class or element you need to target, as explained in the section
+on [identifying the correct CSS selector](#identify-the-correct-css-selector).
+
+It's essential to understand the relationship between the targeted CSS class or element and the component assigned
+`id`, for example:
+
+
+```html title="HTML structure of a `Card`"
+
+
+
Lorem ipsum dolor sit amet consectetur adipisicing elit.
+
+
+```
+
+
+* **Main element with `id`:** There is a `
` with our `id="custom-card"`.
+* **Parent element:** That `
` is wrapped inside a parent `
` with the class name `"card"`. This is the element we need to target to change the background color.
+* **Child element:** The card text is wrapped inside a `
` that is a child of the `
` with our `id`. This is the element we need to target to change the font color.
+
+
+!!! example "Customizing CSS properties in selective components"
+ === "my_css_file.css"
+ ```css
+ /* Apply styling to parent */
+ .card:has(#custom-card) {
+ background-color: white;
+ }
+
+ /* Apply styling to child */
+ #custom-card p {
+ color: black;
+ }
+ ```
+ === "app.py"
+ ```py
+ import vizro.models as vm
+ from vizro import Vizro
+
+ page = vm.Page(
+ title="Changing the card color",
+ components=[
+ vm.Card(id="custom-card", text="""Lorem ipsum dolor sit amet consectetur adipisicing elit."""),
+ vm.Card(text="""Lorem ipsum dolor sit amet consectetur adipisicing elit.""")
+ ],
+ )
+
+ dashboard = vm.Dashboard(pages=[page])
+
+ Vizro().build(dashboard).run()
+ ```
+
+ Run and edit this code in Py.Cafe
+
+ === "app.yaml"
+ ```yaml
+ # Still requires a .py to add data to the data manager and parse YAML configuration
+ # See yaml_version example
+ pages:
+ - components:
+ - text: |
+ Lorem ipsum dolor sit amet consectetur adipisicing elit.
+ type: card
+ id: custom-card
+ - text: |
+ Lorem ipsum dolor sit amet consectetur adipisicing elit.
+ type: card
+ title: Changing the card color
+ ```
+ === "Result"
+ [![CardCSS]][CardCSS]
+
+ [CardCSS]: ../../assets/user_guides/assets/css_change_card.png
+
+
+!!! note "Relationship between model ID and CSS ID"
+
+ Some Vizro components produce a single HTML element with an ID that matches the model ID, allowing you to target it
+ directly using the CSS #id selector. Other components generate multiple HTML elements. Within these, the "core"
+ element will have an ID matching the model ID, while non-core elements may have IDs that are variations of it,
+ such as `{model-id}-title`.
+
+ In all instances, you can determine the correct selector by using Chrome DevTools or a similar tool after setting the
+ appropriate model ID.
+
+
+## Common examples
+
+### Turn off page title
+See the example above on [hiding the page title on selected pages](#overwrite-css-for-selected-pages).
+
+### Change the background color of a card
+See the example above on [customizing CSS properties in selective components](#overwrite-css-for-selected-components).
+
+### Change the global font
+The default fonts for a Vizro app are `Inter, sans-serif, Arial, serif`.
+
+If you need to change the global font, perhaps to adhere to branding guidelines, follow these steps:
+
+1. Download the desired font from a font provider such as [Google Fonts](https://fonts.google.com/).
+2. Place the font file (`.ttf`, `woff2`, etc.) into your `assets` folder. Here’s an example of what the assets folder might look like:
+
+ ![Font Change](../../assets/user_guides/custom_css/font-change.png)
+
+3. Add the font to your CSS file using the `@font-face` rule and apply the font globally to your Vizro app, making sure
+to specify fallback fonts. Add the following to your `custom.css` file:
+
+
+ ```css
+ @font-face {
+ font-family: PlayfairDisplay;
+ src: url("PlayfairDisplay-VariableFont_wght.ttf") format("truetype");
+ }
+
+ * {
+ font-family: PlayfairDisplay, Inter, sans-serif, Arial, serif;
+ }
+ ```
+
+
+4. Note that the modification above applies solely to the dashboard font. To also change the font within the
+Plotly charts, you must specify this at the beginning of your `app.py` file:
+
+ ```python
+ import plotly.io as pio
+
+ pio.templates["vizro_dark"]["layout"]["font_family"] = "PlayfairDisplay, Inter, sans-serif, Arial, serif"
+ pio.templates["vizro_light"]["layout"]["font_family"] = "PlayfairDisplay, Inter, sans-serif, Arial, serif"
+ ```
+
+### Reposition the logo
+By default, the logo appears in the top left corner of the dashboard. You can move it further to the left or right by
+adjusting the `padding` of the `#page-header` element. Here is an example of how to achieve this:
+
+```css
+#page-header {
+ padding-left: 8px;
+}
+```
+
+![Logo positioning](../../assets/user_guides/custom_css/logo-position.png)
+
+
+### Change the styling of a container
+If you want to make the subsections of your dashboard stand out more, you can do this by placing your components
+inside a [Container](container.md) and changing the container's styling, for example, background color, borders, padding, etc.
+
+To do this, you need to change the container's CSS class. Using the DevTool, as explained in the section on
+[identifying the correct CSS selector](#identify-the-correct-css-selector), you'll find that the CSS class for the
+`Container` is `page-component-container`. You can then use this class to set a new `background-color` and `padding`.
+
+!!! example "Style a container"
+ === "custom.css"
+ ```css
+ .page-component-container {
+ background: var(--surfaces-bg-card);
+ padding: 12px;
+ }
+ ```
+ === "app.py"
+ ```py
+ import vizro.models as vm
+ import vizro.plotly.express as px
+ from vizro import Vizro
+
+ iris = px.data.iris()
+
+ page = vm.Page(
+ title="Page with subsections",
+ layout=vm.Layout(grid=[[0, 1]]),
+ components=[
+ vm.Container(
+ title="Container I",
+ components=[vm.Graph(figure=px.scatter(iris, x="sepal_width", y="sepal_length", color="species"))]
+ ),
+ vm.Container(
+ title="Container II",
+ components=[vm.Graph(figure=px.box(iris, x="species", y="sepal_length", color="species"))]
+ )
+ ],
+ )
+
+ dashboard = vm.Dashboard(pages=[page])
+ Vizro().build(dashboard).run()
+ ```
+
+ Run and edit this code in Py.Cafe
+
+ === "app.yaml"
+ ```yaml
+ # Still requires a .py to add data to the data manager and parse YAML configuration
+ # See yaml_version example
+ pages:
+ - title: "Page with subsections"
+ layout:
+ grid: [[0, 1]]
+ components:
+ - type: container
+ title: "Container I"
+ components:
+ - type: graph
+ figure:
+ _target_: scatter
+ data_frame: iris
+ x: sepal_width
+ y: sepal_length
+ color: species
+ - type: container
+ title: "Container II"
+ components:
+ - type: graph
+ figure:
+ _target_: box
+ data_frame: iris
+ x: species
+ y: sepal_length
+ color: species
+ ```
+ === "Result"
+ [![StyleContainer]][StyleContainer]
+
+ [StyleContainer]: ../../assets/user_guides/custom_css/style-container.png
+
+You will notice that the background colors of the charts are different. To align it with the colors of the container,
+you can make the charts' background transparent.
+
+To make the background of all charts transparent:
+
+```py
+import plotly.io as pio
+
+pio.templates["vizro_dark"]["layout"]["paper_bgcolor"] = "rgba(0, 0, 0, 0)"
+pio.templates["vizro_light"]["layout"]["paper_bgcolor"] = "rgba(0, 0, 0, 0)"
+pio.templates["vizro_dark"]["layout"]["plot_bgcolor"] = "rgba(0, 0, 0, 0)"
+pio.templates["vizro_light"]["layout"]["plot_bgcolor"] = "rgba(0, 0, 0, 0)"
+```
+
+To make the background of selected charts transparent:
+
+```py
+@capture(graph)
+def custom_chart(data_frame):
+ ...
+ fig.update_layout(paper_bgcolor="rgba(0, 0, 0, 0)", plot_bgcolor="rgba(0, 0, 0, 0)")
+ return fig
+```
+
+![Transparent charts](../../assets/user_guides/custom_css/transparent-charts.png)
diff --git a/vizro-core/docs/pages/user-guides/run.md b/vizro-core/docs/pages/user-guides/run.md
index 6280b735d..cea73d4d8 100644
--- a/vizro-core/docs/pages/user-guides/run.md
+++ b/vizro-core/docs/pages/user-guides/run.md
@@ -6,7 +6,7 @@ This guide shows you how to launch your dashboard in different ways. By default,
The easiest way to launch your dashboard is to edit the code live on [Py.Cafe](https://py.cafe/).
-Most of our examples have a link below the code, [Run and edit this code in Py.Cafe](https://py.cafe/vizro-official/vizro-iris-analysis), which you can follow to experiment with the code. This will lead you to an editor such as the one below, which displays the dashboard and the code side by side.
+Most of our examples have a link below the code, [Run and edit this code in Py.Cafe](https://py.cafe/vizro-official/vizro-iris-analysis), which you can follow to experiment with the code. This opens an editor such as the one below, which displays the dashboard and the code side by side.