Skip to content

Commit 3223547

Browse files
committed
add html 0px padding to html_page to avoid default padding by some browsers
1 parent ef3f7ad commit 3223547

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

docs/src/settings.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ PlotlyLight.settings.style::Dict{String,String} # CSS styles for the plot <div>
1212
```
1313

1414
Check out e.g. `PlotlyLight.Settings().src` to examine default values.
15+

src/PlotlyLight.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ function html_page(o::Plot)
9393
h.meta(name="viewport", content="width=device-width, initial-scale=1"),
9494
h.meta(name="description", content="PlotlyLight.jl"),
9595
h.title("PlotlyLight.jl"),
96-
h.style("body { padding: 0px; margin: 0px; } /* remove scrollbar in iframe */"),
96+
h.style("html, body { padding: 0px; margin: 0px; } /* remove scrollbar in iframe */"),
9797
),
9898
h.body(html_div(o))
9999
)
@@ -106,6 +106,9 @@ Base.show(io::IO, ::MIME"juliavscode/html", o::Plot) = show(io, MIME"text/html"(
106106

107107
Base.display(::REPL.REPLDisplay, o::Plot) = Cobweb.preview(h.html(h.body(o, style="margin: 0px;")), reuse=settings.reuse_preview)
108108

109+
mathjax = h.script(type="text/javascript", async=true, src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js")
110+
111+
109112
#-----------------------------------------------------------------------------# preset
110113
# `preset_template_<X>` overwrites `settings.layout.template`
111114
# `preset_src_<X>` overwrites `settings.src`

0 commit comments

Comments
 (0)