Skip to content

Commit 6de5fc7

Browse files
committed
fix(MarkdownStream): width and height are now respected; set a maximum width of 680px with auto margins
1 parent adf6bbb commit 6de5fc7

File tree

4 files changed

+9
-4
lines changed

4 files changed

+9
-4
lines changed

js/markdown-stream/markdown-stream.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
@include highlight_styles.atom_one_dark;
77
}
88

9+
shiny-markdown-stream {
10+
display: block;
11+
}
12+
913
/*
1014
Styling for the code-copy button (inspired by Quarto's code-copy feature)
1115
*/

shiny/ui/_markdown_stream.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ def output_markdown_stream(
320320
content: TagChild = "",
321321
content_type: StreamingContentType = "markdown",
322322
auto_scroll: bool = True,
323-
width: CssUnit = "100%",
323+
width: CssUnit = "min(680px, 100%)",
324324
height: CssUnit = "auto",
325325
) -> Tag:
326326
"""
@@ -369,6 +369,7 @@ def output_markdown_stream(
369369
"style": css(
370370
width=as_css_unit(width),
371371
height=as_css_unit(height),
372+
margin="0 auto",
372373
),
373374
"content-type": content_type,
374375
"auto-scroll": "" if auto_scroll else None,

shiny/www/py-shiny/markdown-stream/markdown-stream.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)