Catalog npm
Back to packageRELEASE DETAILS

0.0.1-pre2

npm

@-ft/mode

Theme mode manager

Published5 Sept 2023
Direct dependencies0
Transitive dependenciesNot calculated

README

Current package documentation

mode - Theme mode manager

Dark/light theme mode manager for web

Usage

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;
});

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 0

Native requirements
0 direct targetsNot calculated transitive count
No declared dependencies in this collected response

Declarations describe requirements; they are not a resolved dependency graph.

Distribution files

1 collected
Distribution 1

Source distribution

Source file
Checksums from source
{
  "integrity": "sha512-HiF1f4xiznzgudDj5Irkc4bGMngLCcExM/x4MvnsFbhR2F62I9KoRrgUuKT4momxpDF+yU1V2Jo8vZC4NCkULg==",
  "shasum": "7be2e56fad41a761a535b61d28caff8f924e217f",
  "tarball": "https://registry.npmjs.org/@-ft/mode/-/mode-0.0.1-pre2.tgz",
  "fileCount": 4,
  "unpackedSize": 3246,
  "signatures": [
    {
      "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
      "sig": "MEUCIQC8CfXtTHTtU82gShc+jK/sZLRHNeLW2jzrwk/99FRGVQIgfP6seTJQP2JCKbbFz/EBkUiuzw/A4qorwHopNQAGMJo="
    }
  ]
}

Repository

PENDING
42ts/-ft-mode

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 21:48 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:7e8e5a51c42e5dfd737f1237f8b9e8277187b1887aae256cd6410be625f3ba31

Other collected versions

0.1.014 Sept0.0.610 Sept0.0.510 Sept0.0.49 Sept0.0.39 Sept0.0.29 SeptView all collected versions →