//@ts-check /** * Creates a helper to add or remove global classes that begin with `is-` * @param {string} name */ export const documentMode = (name) => ({ on: () => document.body.classList.add(`is-${name}`), off: () => document.body.classList.remove(`is-${name}`), toggle: () => document.body.classList.toggle(`is-${name}`), has: () => document.body.classList.contains(`is-${name}`), }); export default documentMode;