use BEM classes

add class names for foods, units, keywords (not following BEM closely)
This commit is contained in:
tomtjes
2024-02-14 16:44:12 -05:00
parent 0ee5164aac
commit 8e72108290
9 changed files with 157 additions and 87 deletions

View File

@@ -317,6 +317,10 @@ export function calculateAmount(amount, factor) {
}
}
export function escapeCSS(classname) {
return classname.replace(/\s+/g, "-").toLowerCase()
}
export function roundDecimals(num) {
let decimals = getUserPreference("user_fractions") ? getUserPreference("user_fractions") : 2
return +(Math.round(num + `e+${decimals}`) + `e-${decimals}`)
@@ -748,4 +752,4 @@ export const formFunctions = {
}
return form
},
}
}