mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-09-23 04:55:32 +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) {
|
||||
const value = getComputedStyle(workspaceElement).getPropertyValue(`--${property}`);
|
||||
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;
|
||||
},
|
||||
};
|
||||
|
||||
export default DOMUtils;
|
||||
|
|
Loading…
Add table
Reference in a new issue