2025-12-10 15:04:34 +01:00

14 lines
317 B
JavaScript

export function fromStyleValue(styleValue) {
return styleValue.replaceAll("-', '_").toUpperCase();
}
export function fromStyle(style) {
const entry = Object.entries(this).find(([name, value]) =>
name === fromStyleValue(style) ? value : 0,
);
if (!entry) return;
const [name] = entry;
return name;
}