Current collected state Current
Observed since 20 Oct, 21:48 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
@-ft/mode
Theme mode manager
mode - Theme mode managerDark/light theme mode manager for web
import { mode } from '@-ft/mode';
// initialize mode manager with persistent settings if available
const modeManager = mode(getCookie('mode') ?? 'system');
// apply actual theme when theme is changed
modeManager.watchTheme((theme) => {
if (theme === 'dark') {
document.documentElement.classList.add('dark');
} else {
document.documentElement.classList.remove('dark');
}
});
// save persistent theme settings when mode is changed
modeManager.watchMode((mode) => {
document.cookie = 'mode=' + mode;
});
Download counts and popularity will appear here as the collector receives them.
Declarations describe requirements; they are not a resolved dependency graph.
Source distribution
{
"integrity": "sha512-wERFtX8IVOaoZjctD+OzfkCgD8lo8j3zAsgyFWr3qKxa2Rj1V9OgONaZalZ3Kax2ejoaunxWAkxsVOIHebpnhA==",
"shasum": "417c0b2ecc0b347c1a3b911e9ec200a2f5b3b126",
"tarball": "https://registry.npmjs.org/@-ft/mode/-/mode-0.0.1-pre1.tgz",
"fileCount": 4,
"unpackedSize": 3247,
"signatures": [
{
"keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
"sig": "MEYCIQDrNWrmS5ZJI2tRHu2hcmBp+g2SBak01xdvSyt1Qds1RwIhAPLlHyFZ3gfhYFztfKmBYBWXDdko8WI/8VYhQpo16xny"
}
]
}Observed since 20 Oct, 21:48 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package_version:027bc6cf69dff5ee68487fae9a419d185ce9ad29d316c4d0a3175c3adbb4d64c