{"id":15691446,"url":"https://github.com/anandchowdhary/light-level","last_synced_at":"2026-01-26T04:03:59.932Z","repository":{"id":34902530,"uuid":"188428540","full_name":"AnandChowdhary/light-level","owner":"AnandChowdhary","description":"💡Get a user's light level using CSS @​media(light-level)","archived":false,"fork":false,"pushed_at":"2024-06-18T01:59:35.000Z","size":142,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-16T02:45:15.096Z","etag":null,"topics":["css","light-level","media-queries","typescript"],"latest_commit_sha":null,"homepage":"https://anandchowdhary.github.io/light-level/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AnandChowdhary.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-05-24T13:42:13.000Z","updated_at":"2021-03-26T08:50:14.000Z","dependencies_parsed_at":"2024-10-23T23:08:27.588Z","dependency_job_id":"ffcf52db-074f-4374-9528-33cc6073c2db","html_url":"https://github.com/AnandChowdhary/light-level","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnandChowdhary%2Flight-level","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnandChowdhary%2Flight-level/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnandChowdhary%2Flight-level/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnandChowdhary%2Flight-level/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AnandChowdhary","download_url":"https://codeload.github.com/AnandChowdhary/light-level/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239441677,"owners_count":19639122,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["css","light-level","media-queries","typescript"],"created_at":"2024-10-03T18:21:36.681Z","updated_at":"2025-11-04T21:30:25.712Z","avatar_url":"https://github.com/AnandChowdhary.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 💡 Light level\n\n[![Travis CI](https://img.shields.io/travis/AnandChowdhary/light-level.svg)](https://travis-ci.org/AnandChowdhary/light-level)\n[![Coverage Status](https://coveralls.io/repos/github/AnandChowdhary/light-level/badge.svg?branch=master)](https://coveralls.io/github/AnandChowdhary/light-level?branch=master)\n[![GitHub](https://img.shields.io/github/license/anandchowdhary/light-level.svg)](https://github.com/AnandChowdhary/light-level/blob/master/LICENSE)\n![Vulnerabilities](https://img.shields.io/snyk/vulnerabilities/github/AnandChowdhary/light-level.svg)\n![NPM type definitions](https://img.shields.io/npm/types/light-level-css.svg)\n[![NPM](https://img.shields.io/npm/v/light-level-css.svg)](https://www.npmjs.com/package/light-level-css)\n[![Minzipped size](https://img.shields.io/bundlephobia/minzip/light-level-css.svg)](https://www.npmjs.com/package/light-level-css)\n\n[![NPM](https://nodei.co/npm/light-level-css.png)](https://www.npmjs.com/package/light-level-css)\n\nLight level is a package that tells you a user's preferred light level. It's based on the CSS `@media (light-level)`, which is part of [Media Queries Level 5](https://drafts.csswg.org/mediaqueries-5/). It's around 700 bytes minified, 300 bytes gzipped.\n\n## ⭐ Usage\n\nAdd the dependency from NPM:\n\n```bash\nnpm install light-level-css\n```\n\nImport the package:\n\n```js\nimport lightLevel from \"light-level-css\";\n```\n\nThen call the function:\n\n```js\nconst lightPreference = lightLevel();\n// Returns \"dim\", \"washed\" or \"normal\"\n```\n\n## 💡 Browser support\n\nThis package only works in browsers that natively support `@media (light-level)`, so it just returns `\"normal\"` in unsupported browsers. [Current browser support](https://caniuse.com/#feat=light-level)\n\nBy passing `false` as the argument, you can get `\"unsupported\"` as the value for unsupported browsers:\n\n```js\nconst lightPreference = lightLevel(false);\n// Returns \"dim\", \"washed\", \"normal\", or \"unsupported\"\n```\n\n## 🛠️ Development\n\nInstall dependencies:\n\n```bash\nyarn\n```\n\nCompile Typescript to ES6 before publishing to NPM:\n\n```bash\nyarn build\n```\n\n## 📀 Media Queries Level 5\n\n- 🙅 `prefers-reduced-motion` · [GitHub](https://github.com/AnandChowdhary/prefers-reduced-motion) · [NPM](https://www.npmjs.com/package/prefers-reduced-motion)\n- 🎨 `prefers-color-scheme` · [GitHub](https://github.com/AnandChowdhary/prefers-color-scheme) · [NPM](https://www.npmjs.com/package/prefers-color-scheme)\n- 🕶️ `prefers-contrast` · [GitHub](https://github.com/AnandChowdhary/prefers-contrast) · [NPM](https://www.npmjs.com/package/prefers-contrast)\n- 🎞️ `prefers-reduced-transparency` · [GitHub](https://github.com/AnandChowdhary/prefers-reduced-transparency) · [NPM](https://www.npmjs.com/package/prefers-reduced-transparency)\n- 🌑 `inverted-colors` · [GitHub](https://github.com/AnandChowdhary/inverted-colors) · [NPM](https://www.npmjs.com/package/inverted-colors)\n- 🧖 `environment-blending` · [GitHub](https://github.com/AnandChowdhary/environment-blending) · [NPM](https://www.npmjs.com/package/environment-blending)\n- 💡 `light-level` · [GitHub](https://github.com/AnandChowdhary/light-level) · [NPM](https://www.npmjs.com/package/light-level-css)\n\n## 📝 License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanandchowdhary%2Flight-level","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanandchowdhary%2Flight-level","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanandchowdhary%2Flight-level/lists"}