How the editor canvas looks: the stylesheets of your site, the attributes of
<html> and <body> and an optional frame around the content.
The canvas is an <iframe> built from this configuration, so the content is
rendered with your site's CSS and not the admin's, and the tablet and mobile
widths trigger your media queries for real.
ElementorexCms.Canvas.new(
stylesheets: ["/assets/css/app.css"],
html_attrs: %{"data-theme" => "light"},
body_class: "bg-base-200 p-8",
# the content goes where the frame has `data-exr-mount`
frame: ~s(<main class="mx-auto max-w-3xl rounded-box bg-base-100 p-6" data-exr-mount></main>)
)Options
:stylesheets- URLs of the CSS files (same origin or allowed by your Content-Security-Policy):head- extra HTML for<head>(fonts...):html_attrs- attributes of<html>(data-themefor daisyUI):body_class- classes of<body>:frame- HTML around the content, with an element carryingdata-exr-mountwhere the document goes (default: just that element). It can be a string or anythingPhoenix.HTML.Safe(a rendered component):widths- canvas width per device, default%{"desktop" => 1280, "tablet" => 768, "mobile" => 390}
Summary
Functions
Builds a canvas configuration (see the module docs).