prismicio / prismic-toolbar

An embeddable UI for Prismic content and previews directly on your website.
12 stars 19 forks source link

Mm/fix style #58

Closed MarcMcIntosh closed 4 years ago

MarcMcIntosh commented 4 years ago

56

toolbar style is set to "[object Object]"

isolate and recreated with

<div id="foo" />
<script>
  const elem = document.getElementById("foo")
  const styl =  { width: "100px", height: "100px", backgroundColor: "red" };
  // here
  elem.setAttribute('style", styl);
<script>

Solved by treating style as an object,

Note: this will work on Internet explorer only if Object.assign is polyfilled.