diff --git a/addons/web_editor/static/src/js/editor/snippets.options.js b/addons/web_editor/static/src/js/editor/snippets.options.js index 85895f88da9..007741226b8 100644 --- a/addons/web_editor/static/src/js/editor/snippets.options.js +++ b/addons/web_editor/static/src/js/editor/snippets.options.js @@ -3857,6 +3857,7 @@ const SnippetOptionWidget = Widget.extend({ } const cssProps = weUtils.CSS_SHORTHANDS[params.cssProperty] || [params.cssProperty]; + const borderWidthCssProps = weUtils.CSS_SHORTHANDS['border-width']; const cssValues = cssProps.map(cssProp => { let value = styles.getPropertyValue(cssProp).trim(); if (cssProp === 'box-shadow') { @@ -3866,6 +3867,11 @@ const SnippetOptionWidget = Widget.extend({ values = values.join(' ').replace(color, '').trim(); value = `${color} ${values}${inset ? ' inset' : ''}`; } + if (borderWidthCssProps.includes(cssProp) && value.endsWith('px')) { + // Rounding value up avoids zoom-in issues. + // Zoom-out issues are not an expected use case. + value = `${Math.ceil(parseFloat(value))}px`; + } return value; }); if (cssValues.length === 4 && weUtils.areCssValuesEqual(cssValues[3], cssValues[1], params.cssProperty, this.$target)) {