Skip to content

Commit

Permalink
fix: width should be in px for mo.image (#166)
Browse files Browse the repository at this point in the history
  • Loading branch information
akshayka committed Sep 30, 2023
1 parent 16a6072 commit 1e7bf0f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions marimo/_plugins/stateless/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ def image(
- `src`: the URL of the image or a file-like object
- `alt`: the alt text of the image
- `width`: the width of the image
- `height`: the height of the image
- `width`: the width of the image in pixels
- `height`: the height of the image in pixels
- `rounded`: whether to round the corners of the image
- `style`: a dictionary of CSS styles to apply to the image
Expand All @@ -53,8 +53,8 @@ def image(
resolved_src = io_to_data_url(src, fallback_mime_type="image/png")
styles = create_style(
{
"width": width,
"height": height,
"width": f"{width}px" if width is not None else None,
"height": f"{height}px" if height is not None else None,
"border-radius": "4px" if rounded else None,
**(style or {}),
}
Expand Down

1 comment on commit 1e7bf0f

@vercel
Copy link

@vercel vercel bot commented on 1e7bf0f Sep 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

marimo-storybook – ./frontend

marimo-storybook.vercel.app
marimo-storybook-marimo.vercel.app
marimo-storybook-git-main-marimo.vercel.app

Please sign in to comment.