Skip to content

Commit

Permalink
Remove img CSS classes
Browse files Browse the repository at this point in the history
  • Loading branch information
huong-li-nguyen committed Dec 4, 2024
1 parent 4e0ddb6 commit 45f0994
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 26 deletions.
11 changes: 6 additions & 5 deletions vizro-core/docs/pages/user-guides/card-button.md
Original file line number Diff line number Diff line change
Expand Up @@ -323,17 +323,18 @@ Note the added URL hash `#my-image`. Now create a CSS file placed in your `asset
Use the following pre-defined URL hashes in your image path to apply Vizro's default styling.

#### To float the image next to the text:
To float an image for example to the right of the text, use the `src` attribute as a CSS selector. Follow these steps:

- floating-left: `![](my_image.png#floating-left)`
- floating-right: `![](my_image.png#floating-right)`
- floating-center: `![](my_image.png#floating-center)`
1. Add a hash (#) to the image URL, e.g., `![](assets/images/continents/europe.svg#my-image)`
2. Target that hash in your custom CSS file `img[src*="#my-image"] { float: right; }`

!!! example "Card with floating image"
=== "images.css"
```css
img[src*="#my-image"] {
width: 120px;
height: 120px;
float: right;
}
```

Expand All @@ -349,7 +350,7 @@ Use the following pre-defined URL hashes in your image path to apply Vizro's def
text="""
### My card with floating image!

![](assets/images/continents/europe.svg#my-image#floating-right)
![](assets/images/continents/europe.svg#my-image)

Commodi repudiandae consequuntur voluptatum laborum numquam blanditiis harum quisquam eius sed odit.

Expand Down Expand Up @@ -381,7 +382,7 @@ Use the following pre-defined URL hashes in your image path to apply Vizro's def
pages:
- components:
- text: |
![](assets/images/continents/europe.svg#my-image#floating-right)
![](assets/images/continents/europe.svg#my-image)

Commodi repudiandae consequuntur voluptatum laborum numquam blanditiis harum quisquam eius sed odit.

Expand Down
6 changes: 6 additions & 0 deletions vizro-core/src/vizro/static/css/bootstrap_overwrites.css
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,9 @@ To ensure the dynamic height adjustment and prevent scrolling, the height must b
label[for="theme-selector"] {
display: none;
}

img[src*="icon-top"] {
filter: var(--fill-icon-image-card);
height: 36px;
width: 36px;
}
21 changes: 0 additions & 21 deletions vizro-core/src/vizro/static/css/images.css

This file was deleted.

0 comments on commit 45f0994

Please sign in to comment.