UNPKG

react-use-system-theme

Version:

React Hook to get the system theme (OS theme: light or dark) based on prefers-colors-scheme. Subscribes to changes as well.

90 lines (89 loc) 2.41 kB
{ "name": "react-use-system-theme", "version": "1.1.1", "description": "React Hook to get the system theme (OS theme: light or dark) based on prefers-colors-scheme. Subscribes to changes as well.", "main": "lib/index.js", "module": "es/index.js", "homepage": "https://github.com/zebateira/react-use-system-theme#readme", "author": "Ze Bateira <jlageb@gmail.com>", "license": "MIT", "repository": { "type": "git", "url": "git+https://github.com/zebateira/react-use-system-theme.git" }, "keywords": [ "react", "hook", "hooks", "theme", "theming", "prefers-colors-scheme", "dark-mode", "system", "auto-theme" ], "bugs": { "url": "https://github.com/zebateira/react-use-system-theme/issues" }, "files": [ "lib", "es" ], "scripts": { "build:commonjs": "BABEL_ENV=commonjs babel src -d lib --delete-dir-on-start", "build:es": "BABEL_ENV=es babel src -d es --delete-dir-on-start", "build": "npm run build:commonjs && npm run build:es", "test": "jest --coverage", "lint": "eslint --ignore-path .gitignore .", "prerelease": "npm t && npm run lint && npm run build", "release": "standard-version", "predeploy": "npm run build && cd demo && npm i && npm run build", "deploy": "gh-pages -d demo/build", "postrelease": "git push --follow-tags origin master && npm publish" }, "jest": { "collectCoverageFrom": [ "src/**/*" ] }, "husky": { "hooks": { "pre-commit": "lint-staged", "commit-msg": "commitlint -E HUSKY_GIT_PARAMS" } }, "lint-staged": { "*.js": [ "eslint --fix", "git add" ] }, "commitlint": { "extends": [ "@commitlint/config-conventional" ] }, "peerDependencies": { "react": "^16.12.0" }, "devDependencies": { "@babel/cli": "^7.7.5", "@babel/core": "^7.7.5", "@commitlint/config-conventional": "^8.2.0", "@moxy/babel-preset": "^3.2.1", "@moxy/eslint-config": "^9.1.2", "@testing-library/react": "^9.3.3", "@testing-library/react-hooks": "^3.2.1", "babel-jest": "^24.9.0", "commitlint": "^8.2.0", "eslint": "^6.7.2", "gh-pages": "^2.1.1", "husky": "^3.1.0", "jest": "^24.9.0", "lint-staged": "^9.5.0", "react": "^16.12.0", "react-dom": "^16.12.0", "react-test-renderer": "^16.12.0", "standard-version": "^7.0.1" } }