This commit is contained in:
wukko
2022-09-28 18:21:36 +06:00
parent ab7e38deb5
commit 5593b67a74
10 changed files with 77 additions and 41 deletions

View File

@@ -19,8 +19,20 @@ export function switcher(obj) {
</div>`
}
export function checkbox(action, text, aria) {
return `<label class="checkbox">
export function checkbox(action, text, aria, paddingType) {
let paddingClass = ` `
switch (paddingType) {
case 1:
paddingClass += "bottom-margin"
break;
case 2:
paddingClass += "top-margin"
break;
case 3:
paddingClass += "no-margin"
break;
}
return `<label id="${action}-chkbx" class="checkbox${paddingClass}">
<input id="${action}" type="checkbox" ${aria ? `aria-label="${aria}"` : ''} onclick="checkbox('${action}')">
<span>${text}</span>
</label>`