{"id":21522659,"url":"https://github.com/ianes1978/lit-element-webpack-starter","last_synced_at":"2026-05-02T20:37:17.381Z","repository":{"id":39178106,"uuid":"251659350","full_name":"ianes1978/lit-element-webpack-starter","owner":"ianes1978","description":"webcomponent starter with and without external CSS (Bootstrap)","archived":false,"fork":false,"pushed_at":"2023-01-05T18:06:04.000Z","size":1105,"stargazers_count":0,"open_issues_count":22,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-29T23:51:21.735Z","etag":null,"topics":["bootstrap","lit-element","starter-kit","webcomponents"],"latest_commit_sha":null,"homepage":"","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/ianes1978.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}},"created_at":"2020-03-31T16:13:18.000Z","updated_at":"2021-04-03T13:22:20.000Z","dependencies_parsed_at":"2023-02-04T09:31:23.118Z","dependency_job_id":null,"html_url":"https://github.com/ianes1978/lit-element-webpack-starter","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ianes1978/lit-element-webpack-starter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ianes1978%2Flit-element-webpack-starter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ianes1978%2Flit-element-webpack-starter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ianes1978%2Flit-element-webpack-starter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ianes1978%2Flit-element-webpack-starter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ianes1978","download_url":"https://codeload.github.com/ianes1978/lit-element-webpack-starter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ianes1978%2Flit-element-webpack-starter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32549384,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-02T19:18:06.202Z","status":"ssl_error","status_checked_at":"2026-05-02T19:16:21.335Z","response_time":132,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["bootstrap","lit-element","starter-kit","webcomponents"],"created_at":"2024-11-24T01:11:17.549Z","updated_at":"2026-05-02T20:37:17.362Z","avatar_url":"https://github.com/ianes1978.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# lit-element webcomponent starter JS (+Bootstrap)\nversion Javascript of [lit-element webcomponent starter TS](https://github.com/ianes1978/lit-element-webpack-starter-typescript)\n\n## intro\nThis is a simple starter of a webcomponent builded with lit-element library and webpack bundler.\n![screen](https://github.com/ianes1978/lit-element-webpack-starter/blob/master/images/screenshot.PNG)\n\n## first-component\nexample of naked webcomponent\n\n## bs-component\nA component that load from external css a global style.\n**But preserve the shadowdom for scoped style**.\nI think can be usefull to create a library of webcomponent that have to ereditate the global style.\n\n## webcomponents-loader.js is a polyfill for webcomponents\nwebcomponents-loader.js is a polyfill for webcomponents\n\n*in index.html:*\n```\n    \u003c!-- Load polyfills --\u003e\n    \u003cscript src=\"libs/webcomponents-loader.js\" defer\u003e \u003c/script\u003e\n\n    \u003c!-- Load component when polyfills are definitely ready --\u003e\n    \u003cscript type=\"module\"\u003e\n        // Take care of cases in which the browser runs this\n        // script before it has finished running \n        // webcomponents-loader.js (e.g. Firefox script execution order)\n        window.WebComponents = window.WebComponents || {\n            waitFor(cb) { addEventListener('WebComponentsReady', cb) }\n            }\n\n        WebComponents.waitFor(async () =\u003e {\n            await import('./main.js');\n        });\n    \u003c/script\u003e\n```\n## lit-css-global-scope\nit is a simple module to import global style, you can replace with a simple script if you want:\n```\nimport { css } from 'lit-element';\nconst styleRules = Object.values(document.styleSheets).reduce((obj,styleSheet)=\u003e{\n   return obj = [...obj,...Object.values(styleSheet.cssRules)]\n   },[])\n   \n   let externalStyles =  styleRules.map(rule=\u003erule.cssText).join('\\n');\n   externalStyles = externalStyles.replace(/html {/g,\":host {\");\n   externalStyles = externalStyles.replace(/@import/g,\"/@import\");\n   externalStyles = css([externalStyles]);\n\nexport {externalStyles};\n```\n\n# Use it\n### Project setup\n```\ngit clone https://github.com/ianes1978/lit-element-webpack-starter.git\n\nnpm install\n```\n\n### Compiles and hot-reloads for development\n```\nnpm start\n```\n\n### Compiles and minifies for production\n```\nnpm run build\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fianes1978%2Flit-element-webpack-starter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fianes1978%2Flit-element-webpack-starter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fianes1978%2Flit-element-webpack-starter/lists"}