Skip to content

Commit

Permalink
add html 0px padding to html_page to avoid default padding by some br…
Browse files Browse the repository at this point in the history
…owsers
  • Loading branch information
joshday committed Jun 28, 2024
1 parent ef3f7ad commit 3223547
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/src/settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ PlotlyLight.settings.style::Dict{String,String} # CSS styles for the plot <div>
```

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

5 changes: 4 additions & 1 deletion src/PlotlyLight.jl
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ function html_page(o::Plot)
h.meta(name="viewport", content="width=device-width, initial-scale=1"),
h.meta(name="description", content="PlotlyLight.jl"),
h.title("PlotlyLight.jl"),
h.style("body { padding: 0px; margin: 0px; } /* remove scrollbar in iframe */"),
h.style("html, body { padding: 0px; margin: 0px; } /* remove scrollbar in iframe */"),
),
h.body(html_div(o))
)
Expand All @@ -106,6 +106,9 @@ Base.show(io::IO, ::MIME"juliavscode/html", o::Plot) = show(io, MIME"text/html"(

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

mathjax = h.script(type="text/javascript", async=true, src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js")


#-----------------------------------------------------------------------------# preset
# `preset_template_<X>` overwrites `settings.layout.template`
# `preset_src_<X>` overwrites `settings.src`
Expand Down

0 comments on commit 3223547

Please sign in to comment.