render.mjs 335 B

123456789
  1. function renderHTML(element, { style, vars }, styleProp, projection) {
  2. Object.assign(element.style, style, projection && projection.getProjectionStyles(styleProp));
  3. // Loop over any CSS variables and assign those.
  4. for (const key in vars) {
  5. element.style.setProperty(key, vars[key]);
  6. }
  7. }
  8. export { renderHTML };