{"id":13793362,"url":"https://github.com/silentcicero/hyperapp-styled-components","last_synced_at":"2025-04-12T13:21:19.283Z","repository":{"id":57270127,"uuid":"180591154","full_name":"SilentCicero/hyperapp-styled-components","owner":"SilentCicero","description":"styled-components for hyperapp in under 3kb","archived":false,"fork":false,"pushed_at":"2020-04-30T21:34:19.000Z","size":10,"stargazers_count":18,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-01T17:11:33.814Z","etag":null,"topics":["components","css","hyperapp","in","js","react","styled"],"latest_commit_sha":null,"homepage":"https://styled-components.com/","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/SilentCicero.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-04-10T13:46:21.000Z","updated_at":"2025-01-26T07:06:48.000Z","dependencies_parsed_at":"2022-08-25T02:51:34.682Z","dependency_job_id":null,"html_url":"https://github.com/SilentCicero/hyperapp-styled-components","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SilentCicero%2Fhyperapp-styled-components","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SilentCicero%2Fhyperapp-styled-components/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SilentCicero%2Fhyperapp-styled-components/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SilentCicero%2Fhyperapp-styled-components/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SilentCicero","download_url":"https://codeload.github.com/SilentCicero/hyperapp-styled-components/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248571836,"owners_count":21126522,"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","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":["components","css","hyperapp","in","js","react","styled"],"created_at":"2024-08-03T23:00:19.619Z","updated_at":"2025-04-12T13:21:19.250Z","avatar_url":"https://github.com/SilentCicero.png","language":"JavaScript","funding_links":[],"categories":["Utilities"],"sub_categories":[],"readme":"## hyperapp-styled-components\n\n\u003cdiv\u003e\n  \u003c!-- NPM Version --\u003e\n  \u003ca href=\"https://www.npmjs.org/package/hyperapp-styled-components\"\u003e\n    \u003cimg src=\"http://img.shields.io/npm/v/hyperapp-styled-components.svg\"\n    alt=\"NPM version\" /\u003e\n  \u003c/a\u003e\n\u003c/div\u003e\n\n\u003cbr /\u003e\n\nA super tiny Hyperapp equivalent of [`styled-components`](https://github.com/styled-components/styled-components).\n\n## Install\n\n```\nnpm install --save hyperapp-styled-components\n```\n\n## Usage\n\nFirst add this to your HTML file in the \u003chead\u003e tag: `\u003cstyle type=\"text/css\" id=\"styles\"\u003e\u003c/style\u003e` than..\n\n```js\nimport { h, app } from \"hyperapp\";\nimport styled from 'hyperapp-styled-components';\n\nconst Header = styled.h2`\n  color: #333;\n`;\n\nconst MyButton = styled.button`\n  padding: 10px;\n  border-radius: ${0}px;\n  background: #F1F1F1;\n\n  \u0026:hover {\n    background: ${props =\u003e props.color};\n  }\n`;\n\nconst Wrapper = styled.div`\n  width: 500px;\n  border: 1px solid #aaa;\n\n  @media (min-width: 400px) {\n    width: 100%;\n    background: #F1F1F1;\n  }\n`;\n\napp({\n  init: 0,\n  view: state =\u003e (\n    \u003cWrapper\u003e\n      \u003cHeader\u003eWelcome to Styled Hyperapp {state ? 'Yay!' : ''}\u003c/Header\u003e\n\n      \u003cMyButton onclick={state =\u003e 1}\u003eGo\u003c/MyButton\u003e\n    \u003c/Wrapper\u003e\n  ),\n  node: document.getElementById(\"app\")\n});\n```\n\n## Features\n\n  - Super tiny **2.1kb** gzipped\n  - Completely DOM based\n  - Supports `@media`\n  - Supports `@keyframes` (via `keyframes` method)\n  - Supports pseudo CSS (i.e. `\u0026:hover`)\n  - State can be fed in through primitive methods (i.e `props =\u003e ...`)\n  - No dependencies\n  - Uses template literals and real CSS\n  - Supports all DOM elements\n  - Auto CSS class injection/management\n  - Works with `hyperapp`\n\n## About\n\nI love `styled-components` and needed a HyperApp equivalent for a project. This is the result. It functions almost the same with pseudo and media queries supported. Dynamic props can be fed in through primitive functions; the output of each is a function where props can be fed in, which then returns another function where child elements and strings can be fed in.\n\nA special thanks to [Max Stoiber](https://twitter.com/mxstbr) and the `styled-components` team for coming up with a great component API for mixing CSS and JS.\n\n## Usage with Props\n\n```js\nimport styled from 'hyperapp-styled-components';\n\nconst Header = styled.h2`\n  color: #${props =\u003e props.status === 'success' ? '000' : '333'};\n`;\n\nconst View = () =\u003e () =\u003e (\n  \u003cdiv\u003e\n    \u003cHeader status=\"success\"\u003e\u003c/Header\u003e\n  \u003c/div\u003e\n);\n```\n\n## With Keyframes\n\n```js\nimport styled, { keyframes } from 'hyperapp-styled-components';\n\nconst boxmove = keyframes`\n  0%   {top: 0px;}\n  25%  {top: 200px;}\n  75%  {top: 50px}\n  100% {top: 100px;}\n`;\n\nconst Box = styled.div`\n  background-color: lightcoral;\n  width: 100px;\n  height: 100px;\n  display: block;\n  position :relative;\n  animation: ${boxmove} 5s infinite;\n`;\n\n```\n\n## Important documents\n\n- [Changelog](CHANGELOG.md)\n- [Code of Conduct](CODE_OF_CONDUCT.md)\n- [License](https://raw.githubusercontent.com/SilentCicero/hyperapp-styled-components/master/LICENSE)\n\n## Todo\n\n- Testing\n- Coverage\n- Documentation\n\n## Licence\n\nThis project is licensed under the MIT license, Copyright (c) 2016 Nick Dodson. For more information see LICENSE.md.\n\n```\nThe MIT License\n\nCopyright (c) 2016 Nick Dodson. nickdodson.com \u003cthenickdodson@gmail.com\u003e\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsilentcicero%2Fhyperapp-styled-components","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsilentcicero%2Fhyperapp-styled-components","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsilentcicero%2Fhyperapp-styled-components/lists"}