diff --git a/packages/marko/src/runtime/helpers/style-value.js b/packages/marko/src/runtime/helpers/style-value.js index 8a229a9bb..79afd56aa 100644 --- a/packages/marko/src/runtime/helpers/style-value.js +++ b/packages/marko/src/runtime/helpers/style-value.js @@ -23,7 +23,7 @@ module.exports = function styleHelper(style) { } else if (type === "object") { for (var name in style) { var value = style[name]; - if (value != null) { + if (value != null && value !== false) { if (typeof value === "number" && value) { value += "px"; } diff --git a/packages/marko/test/render/fixtures/style-attr-object/template.marko b/packages/marko/test/render/fixtures/style-attr-object/template.marko index a4059b1aa..22062b8fe 100644 --- a/packages/marko/test/render/fixtures/style-attr-object/template.marko +++ b/packages/marko/test/render/fixtures/style-attr-object/template.marko @@ -1 +1 @@ -div style={color: 'red', fontWeight: 'bold', 'background-color':'blue'} \ No newline at end of file +div style={color: 'red', margin: false, fontWeight: 'bold', 'background-color':'blue'} \ No newline at end of file