mirror of
https://github.com/penpot/penpot.git
synced 2026-05-19 23:13:39 +00:00
14 lines
317 B
JavaScript
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;
|
|
}
|