mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-09-23 13:04:53 +08:00
Also support CSS layout property values with a px
extension #2004
This commit is contained in:
parent
fa46b0c972
commit
470b088aa5
1 changed files with 7 additions and 1 deletions
|
@ -203,11 +203,17 @@ var DOMUtils = {
|
||||||
if (workspaceElement) {
|
if (workspaceElement) {
|
||||||
const value = getComputedStyle(workspaceElement).getPropertyValue(`--${property}`);
|
const value = getComputedStyle(workspaceElement).getPropertyValue(`--${property}`);
|
||||||
if (value.length > 0) {
|
if (value.length > 0) {
|
||||||
return +value;
|
const num = Number(value.replace('px', '').trim());
|
||||||
|
if (!isNaN(num)) {
|
||||||
|
return num;
|
||||||
|
} else {
|
||||||
|
console.warn(`Unable to interpret --${property}:${value}, provide a value in px.`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return defaultValue;
|
return defaultValue;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export default DOMUtils;
|
export default DOMUtils;
|
||||||
|
|
Loading…
Add table
Reference in a new issue