{"id":18941705,"url":"https://github.com/bahrus/be-adoptive","last_synced_at":"2026-04-19T10:31:39.053Z","repository":{"id":143853409,"uuid":"415985549","full_name":"bahrus/be-adoptive","owner":"bahrus","description":"be-adoptive allows Shadow DOM to inherit styles from the parent element.","archived":false,"fork":false,"pushed_at":"2024-01-08T11:57:41.000Z","size":678,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"baseline","last_synced_at":"2025-10-19T12:50:07.200Z","etag":null,"topics":["custom-element","custom-elements","shadow-dom","stylesheets","web-component","web-components"],"latest_commit_sha":null,"homepage":"","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/bahrus.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":"2021-10-11T15:30:12.000Z","updated_at":"2023-02-28T11:58:03.000Z","dependencies_parsed_at":"2024-01-08T13:24:57.965Z","dependency_job_id":null,"html_url":"https://github.com/bahrus/be-adoptive","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bahrus/be-adoptive","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bahrus%2Fbe-adoptive","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bahrus%2Fbe-adoptive/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bahrus%2Fbe-adoptive/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bahrus%2Fbe-adoptive/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bahrus","download_url":"https://codeload.github.com/bahrus/be-adoptive/tar.gz/refs/heads/baseline","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bahrus%2Fbe-adoptive/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32003992,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T20:23:30.271Z","status":"online","status_checked_at":"2026-04-19T02:00:07.110Z","response_time":55,"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":["custom-element","custom-elements","shadow-dom","stylesheets","web-component","web-components"],"created_at":"2024-11-08T12:29:07.380Z","updated_at":"2026-04-19T10:31:39.033Z","avatar_url":"https://github.com/bahrus.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# be-adoptive\n\nbe-adoptive allows Shadow DOM to inherit styles from the parent element.\n\nThis provides a way to benefit from the slotting Shadow DOM provides, while being able to apply styles from the outside.\n\n[![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg)](https://www.webcomponents.org/element/be-adoptive)\n\n[![Playwright Tests](https://github.com/bahrus/be-adoptive/actions/workflows/CI.yml/badge.svg?branch=baseline)](https://github.com/bahrus/be-adoptive/actions/workflows/CI.yml)\n\n\u003ca href=\"https://nodei.co/npm/be-adoptive/\"\u003e\u003cimg src=\"https://nodei.co/npm/be-adoptive.png\"\u003e\u003c/a\u003e\n\n[![How big is this package in your project?](https://img.shields.io/bundlephobia/minzip/be-adoptive?style=for-the-badge)](https://bundlephobia.com/result?p=be-adoptive)\n\n\u003cimg src=\"http://img.badgesize.io/https://cdn.jsdelivr.net/npm/be-adoptive?compression=gzip\"\u003e\n\n## [Demo](https://codepen.io/bahrus/pen/porYqaz)  \n\n\nNative support in Firefox and Safari for constructible stylesheets is now available!\n\n\n## Syntax:\n\n```html\n\u003cstyle\u003e\n    span{\n        color: red;\n    }\n\u003c/style\u003e\n\u003cdiv\u003e\n    \u003ctemplate shadowrootmode=\"open\"\u003e\n        \u003cstyle be-adoptive\u003e\n            div{\n                color: green;\n            }\n        \u003c/style\u003e\n        \u003cspan\u003eHello\u003c/span\u003e\n        \u003cbe-hive\u003e\u003c/be-hive\u003e\n    \u003c/template\u003e\n\u003c/div\u003e\n\u003cspan\u003eHello\u003c/span\u003e\n\u003cbe-hive\u003e\u003c/be-hive\u003e\n```\n\nTo be fully HTML5 compatible, use data-be-adoptive instead of be-adoptive.\n\nThe be-hive component allows us to specify an alternative attribute name, and acts as a \"conduit\" for all the [be-*](https://github.com/bahrus?tab=repositories\u0026q=be-\u0026type=\u0026language=\u0026sort=) components.  Alternatively, we can place an instance of the be-adoptive web component in our shadow DOM, and that will have the same effect.\n\n\u003e **Note**: It has become clear to me, after [following](https://toot.cafe/@nolan/109621170874013105) a discussion of an alternative [open-stylable](https://github.com/nolanlawson/open-stylable), that this solution is far from complete.  To be complete, the platform would need to provide a mechanism to subscribe to additions / removals of stylesheets from any Shadow DOM realm.  Or implement [this proposal](https://github.com/WICG/webcomponents/issues/909), which would render this behavior obsolete (which would be great).\n\n## Viewing Locally\n\n1.  Install git.\n2.  Fork/clone this repo.\n3.  Install node.\n4.  Open command window to folder where you cloned this repo.\n5.  \u003e npm install\n6.  \u003e npm run serve\n7.  Open http://localhost:3030/demo/dev in a modern browser.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbahrus%2Fbe-adoptive","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbahrus%2Fbe-adoptive","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbahrus%2Fbe-adoptive/lists"}