{"_id":"@btfcss/system-color-scheme","_rev":"5-a0ebf5aa02827b3339e940af3783bf6c","name":"@btfcss/system-color-scheme","dist-tags":{"latest":"1.0.4"},"versions":{"1.0.0":{"name":"@btfcss/system-color-scheme","version":"1.0.0","keywords":["Color","Scheme","System","Dark","Light","Theme"],"author":{"name":"Merlin Chatou"},"license":"ISC","_id":"@btfcss/system-color-scheme@1.0.0","maintainers":[{"name":"btfcss","email":"btfcss@gmail.com"}],"homepage":"https://github.com/btfcss/system-color-scheme#readme","bugs":{"url":"https://github.com/btfcss/system-color-scheme/issues"},"dist":{"shasum":"142b2c4a4cebb160283e7e947416143ff23079a8","tarball":"https://registry.npmjs.org/@btfcss/system-color-scheme/-/system-color-scheme-1.0.0.tgz","fileCount":5,"integrity":"sha512-DN9u7p4R4DxrMGER5Yt106D3eJAw0CdleeetXTjuWgo5cClh5Sgdb4stsfGG3PQWLPjtv8cBqBtFBi89tN1c5A==","signatures":[{"sig":"MEUCIQDQNy3AFaW062CtJ6z7Jzm2pDiMniPQkyWW5cxhkj1s2AIgOdwogooipJuurX60xmH+YdpODGbnbUkWlbdy+uT7cpc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":2703308},"main":"index.js","volta":{"node":"20.18.2"},"gitHead":"63fcc593179583043c6eb11cd8e8170b7c4aa523","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"btfcss","email":"btfcss@gmail.com"},"repository":{"url":"git+https://github.com/btfcss/system-color-scheme.git","type":"git"},"_npmVersion":"10.8.2","description":"System color scheme manager","directories":{},"_nodeVersion":"20.18.2","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/system-color-scheme_1.0.0_1747231561121_0.27643076025689317","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@btfcss/system-color-scheme","version":"1.0.1","keywords":["Color","Scheme","System","Dark","Light","Theme"],"author":{"name":"Merlin Chatou"},"license":"ISC","_id":"@btfcss/system-color-scheme@1.0.1","maintainers":[{"name":"btfcss","email":"btfcss@gmail.com"}],"homepage":"https://github.com/btfcss/system-color-scheme#readme","bugs":{"url":"https://github.com/btfcss/system-color-scheme/issues"},"dist":{"shasum":"a90889c564e31e01d618e776fa039e219e03fad7","tarball":"https://registry.npmjs.org/@btfcss/system-color-scheme/-/system-color-scheme-1.0.1.tgz","fileCount":5,"integrity":"sha512-T5xMws+8vRA0oR2Ltr2tSbMJwo1GAHttrSJPbZNA8oSNw1PeT5wYWvewI1HciUZ5rOV1HbTjbrQjt7c6sbNBew==","signatures":[{"sig":"MEUCICoAZn5XOpSoIQ8GAJXkA+FsRAZSPkccwh7sfjPXqxWJAiEAkwoRVShQJYY2gTf/0d9T2HiFv4xqWTJNvazfQ3zyIZM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":2703309},"main":"index.js","volta":{"node":"20.18.2"},"gitHead":"d3bf43b9ef3310f38daf2c1d47fdd8e688098720","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"btfcss","email":"btfcss@gmail.com"},"repository":{"url":"git+https://github.com/btfcss/system-color-scheme.git","type":"git"},"_npmVersion":"10.8.2","description":"System color scheme manager","directories":{},"_nodeVersion":"20.18.2","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/system-color-scheme_1.0.1_1747231872211_0.06320496033889267","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@btfcss/system-color-scheme","version":"1.0.2","keywords":["Color","Scheme","System","Dark","Light","Theme"],"author":{"name":"Merlin Chatou"},"license":"ISC","_id":"@btfcss/system-color-scheme@1.0.2","maintainers":[{"name":"btfcss","email":"btfcss@gmail.com"}],"homepage":"https://github.com/btfcss/system-color-scheme#readme","bugs":{"url":"https://github.com/btfcss/system-color-scheme/issues"},"dist":{"shasum":"dff3dbf7c70848e56f553bf388c95b5239dfa716","tarball":"https://registry.npmjs.org/@btfcss/system-color-scheme/-/system-color-scheme-1.0.2.tgz","fileCount":5,"integrity":"sha512-sQMr87fGVe5w1DhHcO3zG3A2+DAF5F+DrGra6T4APXQtecyHt0fT9OoCse0wpfGD+3J1kIsrAeYBNYmdI29f8Q==","signatures":[{"sig":"MEUCIBrXIKLQN4gmJzq0znoojOPa9/KJhdnZqgfr1h5hUZnGAiEAlgBlSDMvttILFO30We70htVgIcjNUntAYFJfycGSg5M=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":2703578},"main":"index.js","volta":{"node":"20.18.2"},"gitHead":"100761ce00954873286b0a70d5de44a86edfdca9","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"btfcss","email":"btfcss@gmail.com"},"repository":{"url":"git+https://github.com/btfcss/system-color-scheme.git","type":"git"},"_npmVersion":"10.8.2","description":"System color scheme manager","directories":{},"_nodeVersion":"20.18.2","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/system-color-scheme_1.0.2_1747233237494_0.5644581108948097","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"@btfcss/system-color-scheme","version":"1.0.3","keywords":["Color","Scheme","System","Dark","Light","Theme"],"author":{"name":"Merlin Chatou"},"license":"ISC","_id":"@btfcss/system-color-scheme@1.0.3","maintainers":[{"name":"btfcss","email":"btfcss@gmail.com"}],"homepage":"https://github.com/btfcss/system-color-scheme#readme","bugs":{"url":"https://github.com/btfcss/system-color-scheme/issues"},"dist":{"shasum":"13c1bc74b5eb0fd7d970f1f097ab65508e43d9da","tarball":"https://registry.npmjs.org/@btfcss/system-color-scheme/-/system-color-scheme-1.0.3.tgz","fileCount":5,"integrity":"sha512-zvb5SqCofFBY5p5Govlj7bUF7FCuN/SvkfWvFXvd4hxnE/21IPlYEuTjaoWq+qrEV0IMuBD12WmIwepgjUsoUg==","signatures":[{"sig":"MEUCIQCbR02HPqP8beYWhBWiD5ZeBoHBmlhVP+oXFAjvTjqNmwIgfacrywWbqxHnr0FUNq4cV7oOn7M6NH0waOkwq49mW0A=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":2703578},"main":"index.js","volta":{"node":"20.18.2"},"gitHead":"be9a5ff3825adac35f1c2182a5d1609c648d42db","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"btfcss","email":"btfcss@gmail.com"},"repository":{"url":"git+https://github.com/btfcss/system-color-scheme.git","type":"git"},"_npmVersion":"10.8.2","description":"System color scheme manager","directories":{},"_nodeVersion":"20.18.2","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/system-color-scheme_1.0.3_1747312462321_0.7383614427739718","host":"s3://npm-registry-packages-npm-production"}},"1.0.4":{"name":"@btfcss/system-color-scheme","version":"1.0.4","description":"System color scheme manager","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/btfcss/system-color-scheme.git"},"keywords":["Color","Scheme","System","Dark","Light","Theme"],"author":{"name":"Merlin Chatou"},"license":"ISC","bugs":{"url":"https://github.com/btfcss/system-color-scheme/issues"},"homepage":"https://github.com/btfcss/system-color-scheme#readme","volta":{"node":"20.18.2"},"_id":"@btfcss/system-color-scheme@1.0.4","gitHead":"0219e05f0fb290fb2f39aa69a0f94de6f83cf1c1","_nodeVersion":"20.18.2","_npmVersion":"10.8.2","dist":{"integrity":"sha512-CJB7p9VhWluUKoVK29IpE3R6hYUyL0tWhOQXIKz5IDgTP3s1H24tm5c+8KiSuey9x6D9fJ6NXODs11SpBWYmIQ==","shasum":"27272eea6172a4c7251d20eaa377872335774f54","tarball":"https://registry.npmjs.org/@btfcss/system-color-scheme/-/system-color-scheme-1.0.4.tgz","fileCount":5,"unpackedSize":2703783,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIElcX20JsOdEdYy4U89fVZcz8E/hHyYhlqRfnnacYQuJAiEAk2lPn4HiAQwrlhSP+tRdMbKJG9ARM6qt4nFUbay7bNo="}]},"_npmUser":{"name":"btfcss","email":"btfcss@gmail.com"},"directories":{},"maintainers":[{"name":"btfcss","email":"btfcss@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/system-color-scheme_1.0.4_1747312599579_0.06983384138063164"},"_hasShrinkwrap":false}},"time":{"created":"2025-05-14T14:06:01.044Z","modified":"2025-05-15T12:36:40.058Z","1.0.0":"2025-05-14T14:06:01.397Z","1.0.1":"2025-05-14T14:11:12.472Z","1.0.2":"2025-05-14T14:33:57.711Z","1.0.3":"2025-05-15T12:34:22.520Z","1.0.4":"2025-05-15T12:36:39.888Z"},"bugs":{"url":"https://github.com/btfcss/system-color-scheme/issues"},"author":{"name":"Merlin Chatou"},"license":"ISC","homepage":"https://github.com/btfcss/system-color-scheme#readme","keywords":["Color","Scheme","System","Dark","Light","Theme"],"repository":{"type":"git","url":"git+https://github.com/btfcss/system-color-scheme.git"},"description":"System color scheme manager","maintainers":[{"name":"btfcss","email":"btfcss@gmail.com"}],"readme":"# system-color-scheme\n\nThis npm package manage system (OS or browser) color scheme. \nNote this is not browser or user color scheme. This is **system** color scheme from operating system or browser settings. \n\n\n[![Animation showing the system color scheme detection](/images/system-color-scheme.gif)](https://www.youtube.com/watch?v=PnN5bA45lsU)\n\n\n---\n\n## Install\n\n\n```bash\nnpm install btfcss@system-color-scheme\n```\n\n\n## Usage \n\nImport the package \n\n```js\nimport systemColorScheme from \"@btfcss/system-color-scheme\";\n```\n\n### Get system color scheme\n\nThe `get()` function returns a string containing system color scheme `[ \"light\" | \"dark\" ] :\n\n``` js\n// Should display \"light\" or \"dark\"\nconsole.log (systemColorScheme.get());\n```\n\n\n\nAlternatively, the `isDark()` function returns true if the system color scheme is dark, false otherwise. \n\nThe following code log the system color scheme in the console\n\n\n```js\nif (systemColorScheme.isDark()) \n  console.log ('System color scheme is dark');\nelse\n  console.log ('System color scheme is light');\n```\n\n---\n\n\n\n### Detect system color scheme changes\n\nThe function `addEventListenerOnChange(callback)` runs the callback function when system color scheme changes. When the callback function is called, the parameter is true if the system color scheme changed to dark, false otherwise. \n\n``` js\nsystemColorScheme.addEventListenerOnChange((isDark) => {\n  if (isDark) console.log(\"System color scheme changed for dark\");\n  else console.log(\"System color scheme changed for light\");\n})\n```","readmeFilename":"README.md"}