diff --git a/src/components/ElementPopup.vue b/src/components/ElementPopup.vue index a49dbb0..21764fa 100644 --- a/src/components/ElementPopup.vue +++ b/src/components/ElementPopup.vue @@ -375,6 +375,7 @@ const generatePreviewCss = () => { const properties = []; + // Include all properties with their current values if (fontFamily.value.value) { properties.push(` font-family: ${fontFamily.value.value};`); } @@ -390,16 +391,16 @@ const generatePreviewCss = () => { if (textAlign.value.value) { properties.push(` text-align: ${textAlign.value.value};`); } - if (color.value.value && color.value.value !== 'rgb(0, 0, 0)') { + if (color.value.value) { properties.push(` color: ${color.value.value};`); } - if (background.value.value && background.value.value !== 'transparent') { + if (background.value.value) { properties.push(` background: ${background.value.value};`); } - if (marginOuter.value.value) { + if (marginOuter.value.value !== undefined && marginOuter.value.value !== null) { properties.push(` margin: ${marginOuter.value.value}${marginOuter.value.unit};`); } - if (paddingInner.value.value) { + if (paddingInner.value.value !== undefined && paddingInner.value.value !== null) { properties.push(` padding: ${paddingInner.value.value}${paddingInner.value.unit};`); } diff --git a/src/components/PagePopup.vue b/src/components/PagePopup.vue index d82b8ef..80a7a5c 100644 --- a/src/components/PagePopup.vue +++ b/src/components/PagePopup.vue @@ -622,9 +622,11 @@ const generatePreviewCss = () => { const properties = []; + // Always include margin with current values const marginValue = `${margins.value.top.value}${margins.value.top.unit} ${margins.value.right.value}${margins.value.right.unit} ${margins.value.bottom.value}${margins.value.bottom.unit} ${margins.value.left.value}${margins.value.left.unit}`; properties.push(` margin: ${marginValue};`); + // Include background if it has a value if (background.value.value) { properties.push(` background: ${background.value.value};`); }