revert base folder structure to src/*

This commit is contained in:
Roman committed 2020-06-10 11:25:17 +03:00
1 parent afa8864452
commit 81c2a75d73
750 files changed
+44 -43

No files matched your search

+17
View File
@@ -0,0 +1,17 @@
// Helper for getting/setting css-variables
export function cssVar(elem: HTMLElement) {
return {
get(name: string) {
const value = window.getComputedStyle(elem).getPropertyValue(name).trim();
return {
toString: () => value,
valueOf: () => parseFloat(value)
};
},
set(name: string, value: number | string) {
if (typeof value === "number") value = value + "px";
elem.style.setProperty(name, value);
}
}
}