diff --git a/lib/properties/border.js b/lib/properties/border.js index 08b61714..bd6d606e 100644 --- a/lib/properties/border.js +++ b/lib/properties/border.js @@ -92,7 +92,15 @@ module.exports.definition = { }); if (val || typeof val === "string") { const priority = this._priorities.get(property) ?? ""; - this._borderSetter(property, val, priority); + if (this._updating) { + const shorthandValue = + typeof val === "string" + ? val + : (Array.isArray(val) ? val : Object.values(val)).join(" "); + this._setProperty(property, shorthandValue, priority); + } else { + this._borderSetter(property, val, priority); + } } } }, diff --git a/lib/properties/borderBottom.js b/lib/properties/borderBottom.js index e2b47f15..68259d23 100644 --- a/lib/properties/borderBottom.js +++ b/lib/properties/borderBottom.js @@ -85,7 +85,15 @@ module.exports.definition = { !this._priorities.get(shorthand) && this._priorities.has(property) ? this._priorities.get(property) : ""; - this._borderSetter(property, val, priority); + if (this._updating) { + const shorthandValue = + typeof val === "string" + ? val + : (Array.isArray(val) ? val : Object.values(val)).join(" "); + this._setProperty(property, shorthandValue, priority); + } else { + this._borderSetter(property, val, priority); + } } } }, diff --git a/lib/properties/borderColor.js b/lib/properties/borderColor.js index 0a571f4e..f43909ac 100644 --- a/lib/properties/borderColor.js +++ b/lib/properties/borderColor.js @@ -95,7 +95,15 @@ module.exports.definition = { !this._priorities.get(shorthand) && this._priorities.has(property) ? this._priorities.get(property) : ""; - this._borderSetter(property, val, priority); + if (this._updating) { + const shorthandValue = + typeof val === "string" + ? val + : (Array.isArray(val) ? val : Object.values(val)).join(" "); + this._setProperty(property, shorthandValue, priority); + } else { + this._borderSetter(property, val, priority); + } } } }, diff --git a/lib/properties/borderLeft.js b/lib/properties/borderLeft.js index 901128d3..3e417824 100644 --- a/lib/properties/borderLeft.js +++ b/lib/properties/borderLeft.js @@ -85,7 +85,15 @@ module.exports.definition = { !this._priorities.get(shorthand) && this._priorities.has(property) ? this._priorities.get(property) : ""; - this._borderSetter(property, val, priority); + if (this._updating) { + const shorthandValue = + typeof val === "string" + ? val + : (Array.isArray(val) ? val : Object.values(val)).join(" "); + this._setProperty(property, shorthandValue, priority); + } else { + this._borderSetter(property, val, priority); + } } } }, diff --git a/lib/properties/borderRight.js b/lib/properties/borderRight.js index 788fa8ff..42d9ea3b 100644 --- a/lib/properties/borderRight.js +++ b/lib/properties/borderRight.js @@ -85,7 +85,15 @@ module.exports.definition = { !this._priorities.get(shorthand) && this._priorities.has(property) ? this._priorities.get(property) : ""; - this._borderSetter(property, val, priority); + if (this._updating) { + const shorthandValue = + typeof val === "string" + ? val + : (Array.isArray(val) ? val : Object.values(val)).join(" "); + this._setProperty(property, shorthandValue, priority); + } else { + this._borderSetter(property, val, priority); + } } } }, diff --git a/lib/properties/borderStyle.js b/lib/properties/borderStyle.js index d0b73124..7b992ea6 100644 --- a/lib/properties/borderStyle.js +++ b/lib/properties/borderStyle.js @@ -95,7 +95,15 @@ module.exports.definition = { !this._priorities.get(shorthand) && this._priorities.has(property) ? this._priorities.get(property) : ""; - this._borderSetter(property, val, priority); + if (this._updating) { + const shorthandValue = + typeof val === "string" + ? val + : (Array.isArray(val) ? val : Object.values(val)).join(" "); + this._setProperty(property, shorthandValue, priority); + } else { + this._borderSetter(property, val, priority); + } } } }, diff --git a/lib/properties/borderTop.js b/lib/properties/borderTop.js index d300f297..ef756665 100644 --- a/lib/properties/borderTop.js +++ b/lib/properties/borderTop.js @@ -85,7 +85,15 @@ module.exports.definition = { !this._priorities.get(shorthand) && this._priorities.has(property) ? this._priorities.get(property) : ""; - this._borderSetter(property, val, priority); + if (this._updating) { + const shorthandValue = + typeof val === "string" + ? val + : (Array.isArray(val) ? val : Object.values(val)).join(" "); + this._setProperty(property, shorthandValue, priority); + } else { + this._borderSetter(property, val, priority); + } } } }, diff --git a/lib/properties/borderWidth.js b/lib/properties/borderWidth.js index a16d915a..aa44fe71 100644 --- a/lib/properties/borderWidth.js +++ b/lib/properties/borderWidth.js @@ -96,7 +96,15 @@ module.exports.definition = { !this._priorities.get(shorthand) && this._priorities.has(property) ? this._priorities.get(property) : ""; - this._borderSetter(property, val, priority); + if (this._updating) { + const shorthandValue = + typeof val === "string" + ? val + : (Array.isArray(val) ? val : Object.values(val)).join(" "); + this._setProperty(property, shorthandValue, priority); + } else { + this._borderSetter(property, val, priority); + } } } },