mirror of
https://github.com/penpot/penpot.git
synced 2026-05-26 18:33:43 +00:00
15 lines
321 B
JavaScript
15 lines
321 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;
|
|
}
|