1
1
mirror of https://github.com/rsms/inter.git synced 2024-11-22 11:02:55 +03:00

website: fix issue in lab where letterSpacing=0 would be interpreted as "auto"

This commit is contained in:
Rasmus Andersson 2022-06-01 08:58:42 -07:00
parent 867d63c790
commit 77b4d1f683

View File

@ -1057,15 +1057,14 @@ function main() {
} }
let letterSpacingVar = vars.bind('letterSpacing', (el, v) => { let letterSpacingVar = vars.bind('letterSpacing', (el, v) => {
resetLetterSpacingButton.classList.toggle("disabled", !v) resetLetterSpacingButton.classList.toggle("disabled", v === '')
if (v) { if (v !== '') {
resetLetterSpacingButton.tabIndex = null resetLetterSpacingButton.tabIndex = null
} else { } else {
resetLetterSpacingButton.tabIndex = -1 resetLetterSpacingButton.tabIndex = -1
} }
if (!v) { if (v === '')
v = calcImplicitLetterSpacing(sizeVar.getValue(), el) v = calcImplicitLetterSpacing(sizeVar.getValue(), el)
}
setCSSProp('letter-spacing', (v / 100) + 'em') setCSSProp('letter-spacing', (v / 100) + 'em')
}, (el, prevValue, ev) => { }, (el, prevValue, ev) => {
if (ev && !ev.inputType && !prevValue) { if (ev && !ev.inputType && !prevValue) {