{"id":23466055,"url":"https://github.com/adamlacombe/shadow-dom-inject-styles","last_synced_at":"2025-08-26T23:33:00.243Z","repository":{"id":159600403,"uuid":"143656536","full_name":"adamlacombe/Shadow-DOM-inject-styles","owner":"adamlacombe","description":":tada: A helper function to easily modify Shadow DOM CSS.","archived":true,"fork":false,"pushed_at":"2020-06-11T15:19:08.000Z","size":12,"stargazers_count":46,"open_issues_count":1,"forks_count":8,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-25T02:46:14.407Z","etag":null,"topics":["css","ionic4","shadow-dom","stenciljs","web-components"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/shadow-dom-inject-styles","language":"JavaScript","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/adamlacombe.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":"2018-08-06T00:02:16.000Z","updated_at":"2024-06-21T23:22:48.000Z","dependencies_parsed_at":null,"dependency_job_id":"5f93672b-affe-4b51-86a7-0ae20c240bf1","html_url":"https://github.com/adamlacombe/Shadow-DOM-inject-styles","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/adamlacombe/Shadow-DOM-inject-styles","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamlacombe%2FShadow-DOM-inject-styles","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamlacombe%2FShadow-DOM-inject-styles/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamlacombe%2FShadow-DOM-inject-styles/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamlacombe%2FShadow-DOM-inject-styles/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adamlacombe","download_url":"https://codeload.github.com/adamlacombe/Shadow-DOM-inject-styles/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamlacombe%2FShadow-DOM-inject-styles/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272267230,"owners_count":24903642,"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","status":"online","status_checked_at":"2025-08-26T02:00:07.904Z","response_time":60,"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","ionic4","shadow-dom","stenciljs","web-components"],"created_at":"2024-12-24T11:51:34.019Z","updated_at":"2025-08-26T23:33:00.079Z","avatar_url":"https://github.com/adamlacombe.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Shadow-DOM-inject-styles\nA helper function to easily modify Shadow DOM CSS.\n\n## Install\n```bash\nnpm install shadow-dom-inject-styles --save\n```\n\n## Vanilla JS Example / Demo\n[jsfiddle](https://jsfiddle.net/ry4sbnom/1/)\n\n```html\n\u003cscript type=\"module\"\u003e\n  import {injectStyles} from 'https://unpkg.com/shadow-dom-inject-styles@latest/dist/index.js';\n\n  setTimeout(() =\u003e {\n\n    const toolbar = document.querySelector('ion-app \u003e ion-header \u003e ion-toolbar');\n\n    // language=CSS\n    const styles = `\n        .toolbar-background {\n            background: red !important;\n        }\n        .toolbar-container {\n            color: #fff !important;\n        }\n    `;\n\n    injectStyles(toolbar, '.toolbar-background', styles);\n\n  }, 200);\n\u003c/script\u003e\n```\n\n## Typescript Example\n\n```ts\nimport {injectStyles} from 'shadow-dom-inject-styles';\n\nconst toolbar = (this.el.querySelector('ion-header \u003e ion-toolbar') as HTMLElement);\n\n// language=CSS\nconst styles = `\n  .toolbar-background {\n    background: red !important;;\n  }\n`;\n\ninjectStyles(toolbar, '.toolbar-background', styles);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadamlacombe%2Fshadow-dom-inject-styles","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadamlacombe%2Fshadow-dom-inject-styles","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadamlacombe%2Fshadow-dom-inject-styles/lists"}