{"id":15099462,"url":"https://github.com/bre97-web/light-dark-switch","last_synced_at":"2025-03-27T13:36:22.555Z","repository":{"id":176570954,"uuid":"659094356","full_name":"bre97-web/light-dark-switch","owner":"bre97-web","description":"适用于任意框架的dark类名switch按钮。","archived":false,"fork":false,"pushed_at":"2023-08-13T09:46:46.000Z","size":145,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-01T18:11:18.141Z","etag":null,"topics":["component","html","html-css-js","lit","no-framework","react","switch","vue","web-component"],"latest_commit_sha":null,"homepage":"https://bre97-web.github.io/light-dark-switch/","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/bre97-web.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":"2023-06-27T06:09:09.000Z","updated_at":"2023-08-13T04:18:01.000Z","dependencies_parsed_at":"2025-02-01T18:11:19.554Z","dependency_job_id":"86e6329b-f62d-443e-844e-5de53db5426a","html_url":"https://github.com/bre97-web/light-dark-switch","commit_stats":null,"previous_names":["bre97-web/light-dark-switch"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bre97-web%2Flight-dark-switch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bre97-web%2Flight-dark-switch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bre97-web%2Flight-dark-switch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bre97-web%2Flight-dark-switch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bre97-web","download_url":"https://codeload.github.com/bre97-web/light-dark-switch/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245855222,"owners_count":20683472,"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":["component","html","html-css-js","lit","no-framework","react","switch","vue","web-component"],"created_at":"2024-09-25T17:21:24.492Z","updated_at":"2025-03-27T13:36:22.550Z","avatar_url":"https://github.com/bre97-web.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# light-dark-switch\n\nlight-dark-switch是根据html标签类名驱动的Web Component，它可以在任何位置使用。\n\n# Quick Start\n## Install\n```\nnpm i light-dark-switch\n```\n\n## Import\nin index.html\n\n```html\n\u003cscript src='./node/moduels/light-dark-switch/light-dark-switch.js'\u003e\u003c/script\u003e\n```\n\nin main.js\n```js\nimport 'light-dark-switch/light-dark-switch.js'\n```\n\nin main.ts\n```ts\nimport 'light-dark-switch/light-dark-switch'\n```\n\n## Usage\n\n```html\n\u003clight-dark-switch\u003e\u003c/light-dark-switch\u003e\n\u003clight-dark-switch selected\u003e\u003c/light-dark-switch\u003e\n\u003clight-dark-switch enable-sync\u003e\u003c/light-dark-switch\u003e\n\u003clight-dark-switch disabled\u003e\u003c/light-dark-switch\u003e\n```\n\n# Documents\n## Properties\n|Property Name|Document|\n|:--|:--|\n|enable-sync|使按钮在html的dark类名变更后**同步**|\n|selected|使按钮在**首次渲染后的选择状态**为已选择（selected）,它会被html的实际类名影响|\n|disabled|使按钮**不可用**|\n\n## Methods\n|Method|Returns|\n|:--|--:|\n|select()|void|\n|unSelect()|void|\n|enableSync()|void|\n|disableSync()|void|\n|isSelected()|boolean|\n|isDisabled()|boolean|\n|isSync()|boolean|\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbre97-web%2Flight-dark-switch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbre97-web%2Flight-dark-switch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbre97-web%2Flight-dark-switch/lists"}