{"id":50717606,"url":"https://github.com/baotlake/stylesheet-map","last_synced_at":"2026-06-09T20:01:45.254Z","repository":{"id":251593258,"uuid":"837823459","full_name":"baotlake/stylesheet-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":"2026-06-01T15:47:14.000Z","size":59,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-06-01T16:28:27.782Z","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-08-04T06:21:55.000Z","updated_at":"2026-06-01T16:05:07.000Z","dependencies_parsed_at":"2024-10-26T12:07:15.262Z","dependency_job_id":"96b3f7a9-73ce-435b-b40a-f9d5118e9f3f","html_url":"https://github.com/baotlake/stylesheet-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","baotlake/stylesheet-map"],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/baotlake/stylesheet-map","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baotlake%2Fstylesheet-map","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baotlake%2Fstylesheet-map/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baotlake%2Fstylesheet-map/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baotlake%2Fstylesheet-map/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/baotlake","download_url":"https://codeload.github.com/baotlake/stylesheet-map/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baotlake%2Fstylesheet-map/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34123172,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-09T02:00:06.510Z","response_time":63,"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":"2026-06-09T20:01:41.240Z","updated_at":"2026-06-09T20:01:45.250Z","avatar_url":"https://github.com/baotlake.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# StyleSheetMap\n\nA Map-like wrapper around `CSSStyleSheet` for managing CSS rules by key. Add, update, and delete rules with key-value semantics — works with constructable stylesheets and `adoptedStyleSheets`.\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%2Fstylesheet-map","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbaotlake%2Fstylesheet-map","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbaotlake%2Fstylesheet-map/lists"}