{"id":20848354,"url":"https://github.com/lewisvrobinson/styled-elements","last_synced_at":"2026-04-20T23:31:12.501Z","repository":{"id":42875823,"uuid":"256384789","full_name":"lewisvrobinson/styled-elements","owner":"lewisvrobinson","description":"An experiment to recreate the styled-components API ","archived":false,"fork":false,"pushed_at":"2023-01-06T03:49:14.000Z","size":902,"stargazers_count":1,"open_issues_count":11,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-12-28T13:29:25.883Z","etag":null,"topics":["css-in-js","styled-components","vanilla-javascript"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lewisvrobinson.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-04-17T02:49:22.000Z","updated_at":"2023-03-07T16:59:29.000Z","dependencies_parsed_at":"2023-02-05T06:17:02.311Z","dependency_job_id":null,"html_url":"https://github.com/lewisvrobinson/styled-elements","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/lewisvrobinson/styled-elements","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lewisvrobinson%2Fstyled-elements","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lewisvrobinson%2Fstyled-elements/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lewisvrobinson%2Fstyled-elements/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lewisvrobinson%2Fstyled-elements/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lewisvrobinson","download_url":"https://codeload.github.com/lewisvrobinson/styled-elements/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lewisvrobinson%2Fstyled-elements/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32070546,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-20T21:26:33.338Z","status":"ssl_error","status_checked_at":"2026-04-20T21:26:22.081Z","response_time":94,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["css-in-js","styled-components","vanilla-javascript"],"created_at":"2024-11-18T02:25:40.775Z","updated_at":"2026-04-20T23:31:12.483Z","avatar_url":"https://github.com/lewisvrobinson.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Styled Elements\n\n![Specs](https://github.com/lewisvrobinson/styled-elements/workflows/Specs/badge.svg)\n\n🚨 An **experiment** to recreate the [styled-components](https://github.com/styled-components) API (kinda).\n\nElement styles are appended to a `\u003cstyle\u003e` element. Each styled element is assigned a unique ID to scope the styles. This ID is appended to the elements `classList`.\n\nBecause this runs in the browser rather than as part of a build step all styling will be applied *after* the JS has been parsed by the client. This will cause there to be a flash of unstyled elements and therefore is not intended for production.\n\n## Create a styled element\n\n```js\nconst myElement = styled.div`\n  background: lightgreen;\n  padding: 2em;\n  margin-bottom: 2em; \n  border-radius: 0.5em;\n`\n```\n\n## Style existing elements\n```js\nconst existingElement = document.querySelector('button')\n\nstyled(existingElement)`\n  padding: 2em;\n  background: linear-gradient(\n    ${45}deg, \n    purple, \n    rebeccapurple\n  );\n  color: white;\n`\n```\n\n## Theming\n\n```js\nstyled.setTheme({ \n  colors: { primary: 'purple' }\n})\n        \nconst themedElement = styled.button`\n  background: ${({ theme }) =\u003e theme.colors.primary};\n  color: #fff;\n`\n```\n\n## Global Styles\nThe globalCSS method can create global styles.\n\n```js\nglobalCSS`\n  *\u003e* {\n    box-sizing: border-box;\n  }\n  body {\n    background: #fff;\n    border: 1em solid #eee;\n    padding: 1em;\n    margin: 0;\n    min-height: 100vh;\n  }\n  pre {\n    background: #eee;\n    padding: .5em\n  }\n  code { color: #333;}\n`\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flewisvrobinson%2Fstyled-elements","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flewisvrobinson%2Fstyled-elements","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flewisvrobinson%2Fstyled-elements/lists"}