diff --git a/packages/gallery/src/services/style.js b/packages/gallery/src/services/style.js index b1030c1..7bd5f24 100644 --- a/packages/gallery/src/services/style.js +++ b/packages/gallery/src/services/style.js @@ -24,8 +24,19 @@ export function el(sig, ...attrsOrChildren) { delete attrs.css; delete attrs.styles; } + if (isObject(attrs.class)) { + const oldClassObj = attrs.class; + attrs.class = Object.entries(oldClassObj) + .reduce((acc, [key, value]) => { + if (value) { + acc.push(key); + } + return acc; + }, []) + .join(' '); + } } - return defineElement(sig, attrs, ...children); + return defineElement(sig, attrs, children); } export function styled(styles, tagName = 'div') {