Fix input boxes with borders (#167252)

Fix input boxes with borders (Fixes #167209)
This commit is contained in:
Martin Aeschlimann
2022-11-25 15:27:36 +01:00
committed by GitHub
parent ebfbb8cad9
commit 46685b5669
3 changed files with 28 additions and 5 deletions

View File

@@ -1206,6 +1206,21 @@ export function asCSSPropertyValue(value: string) {
return `'${value.replace(/'/g, '%27')}'`;
}
export function asCssValueWithDefault(cssPropertyValue: string | undefined, dflt: string): string {
if (cssPropertyValue !== undefined) {
const variableMatch = cssPropertyValue.match(/^\s*var\((.+)\)$/);
if (variableMatch) {
const varArguments = variableMatch[1].split(',', 2);
if (varArguments.length === 2) {
dflt = asCssValueWithDefault(varArguments[1].trim(), dflt);
}
return `var(${varArguments[0]}, ${dflt})`;
}
return cssPropertyValue;
}
return dflt;
}
export function triggerDownload(dataOrUri: Uint8Array | URI, name: string): void {
// If the data is provided as Buffer, we create a