{"id":15820643,"url":"https://github.com/baotlake/style-sheet-map","last_synced_at":"2026-01-19T02:33:10.076Z","repository":{"id":251593258,"uuid":"837823459","full_name":"baotlake/style-sheet-map","owner":"baotlake","description":"A StyleSheetMap instance is a Map-like object that allows adding, updating, and deleting CSS rules through key-value pairs. It provides a convenient way to manage and manipulate CSS stylesheets, simplifying the handling of dynamic styles.","archived":false,"fork":false,"pushed_at":"2024-08-04T11:26:40.000Z","size":56,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-18T02:26:21.446Z","etag":null,"topics":["css","frontend","javascript","library","style-sheet"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/style-sheet-map","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/baotlake.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":"2024-08-04T06:21:55.000Z","updated_at":"2025-06-12T14:19:45.000Z","dependencies_parsed_at":"2024-10-26T12:07:15.262Z","dependency_job_id":"168c172a-bc68-45fd-b016-443e42f8d50e","html_url":"https://github.com/baotlake/style-sheet-map","commit_stats":{"total_commits":8,"total_committers":1,"mean_commits":8.0,"dds":0.0,"last_synced_commit":"b47e3617fd7e4f72de69b7578751c30fd969c241"},"previous_names":["baotlake/style-sheet-map"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/baotlake/style-sheet-map","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baotlake%2Fstyle-sheet-map","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baotlake%2Fstyle-sheet-map/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baotlake%2Fstyle-sheet-map/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baotlake%2Fstyle-sheet-map/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/baotlake","download_url":"https://codeload.github.com/baotlake/style-sheet-map/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baotlake%2Fstyle-sheet-map/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28558236,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-19T00:46:33.223Z","status":"online","status_checked_at":"2026-01-19T02:00:08.049Z","response_time":67,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","frontend","javascript","library","style-sheet"],"created_at":"2024-10-05T07:04:33.213Z","updated_at":"2026-01-19T02:33:10.054Z","avatar_url":"https://github.com/baotlake.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# StyleSheetMap\n\nA StyleSheetMap instance is a Map-like object that allows adding, updating, and deleting CSS rules through key-value pairs. It provides a convenient way to manage and manipulate CSS stylesheets, simplifying the handling of dynamic styles.\n\n## Installation\n\n```shell\n# npm\nnpm i style-sheet-map\n\n# yarn\nyarn add style-sheet-map\n\n# pnpm\npnpm add style-sheet-map\n```\n\n## Usage\n\n```javascript\nimport StyleSheetMap from \"style-sheet-map\";\n\n// Create a new StyleSheetMap instance\nconst styleMap = new StyleSheetMap({\n  rules: [\n    [\"header\", \"header { color: blue; }\"],\n    [\"paragraph\", \"p { font-size: 16px; }\"],\n  ],\n  onCreated: (sheet) =\u003e {\n    document.adoptedStyleSheets = [...document.adoptedStyleSheets, sheet];\n  },\n});\n\n// Dynamically adding new CSS rules\nstyleMap.set(\"button\", \"button { background-color: green; }\");\n\n// Update existing CSS rules\nstyleMap.set(\"header\", \"header { color: red; }\");\n\n// Deleting a CSS rule\nstyleMap.delete(\"paragraph\");\n\n// Disable the entire stylesheet\nstyleMap.disable = true;\n```\n\n## Project Origin\n\nThe concept and code for StyleSheetMap were initially developed as part of the [Anything Copilot project](https://github.com/baotlake/anything-copilot). This project extracts and refines that functionality into a standalone, general-purpose module.\n\nDiscover more about its origins: [Anything Copilot](https://ziziyi.com/anything-copilot)\n\n## License\n\nThis project is licensed under the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbaotlake%2Fstyle-sheet-map","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbaotlake%2Fstyle-sheet-map","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbaotlake%2Fstyle-sheet-map/lists"}