{"id":17988380,"url":"https://github.com/coelhucas/mini-styled","last_synced_at":"2025-03-25T22:33:37.617Z","repository":{"id":46895961,"uuid":"403088163","full_name":"coelhucas/mini-styled","owner":"coelhucas","description":"Small subset of styled-components 💅","archived":false,"fork":false,"pushed_at":"2021-09-21T22:22:18.000Z","size":49,"stargazers_count":15,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-21T02:12:09.290Z","etag":null,"topics":["css","hacktoberfest","react","styles","stylis"],"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/coelhucas.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":"2021-09-04T15:13:19.000Z","updated_at":"2024-02-03T17:51:06.000Z","dependencies_parsed_at":"2022-08-28T11:23:02.255Z","dependency_job_id":null,"html_url":"https://github.com/coelhucas/mini-styled","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/coelhucas%2Fmini-styled","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coelhucas%2Fmini-styled/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coelhucas%2Fmini-styled/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coelhucas%2Fmini-styled/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/coelhucas","download_url":"https://codeload.github.com/coelhucas/mini-styled/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245556177,"owners_count":20634867,"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":["css","hacktoberfest","react","styles","stylis"],"created_at":"2024-10-29T19:11:33.664Z","updated_at":"2025-03-25T22:33:37.281Z","avatar_url":"https://github.com/coelhucas.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mini-styled 💅\n\n## Abstract\nThis is meant to be a subset of [styled-components](https://github.com/styled-components/styled-components) features. It was made as a study project in order to give better understanding of the original\n`styled-components` source and some of the concepts usages.\n\nℹ️ This project is ~1.8% the size of real `styled-components` (package unpacked size);\n\n⚠️ It doesn't work with SSR, since this library uses a [browser API](https://developer.mozilla.org/en-US/docs/Web/API/Document). If you need something for a real production application, use [styled-components](https://github.com/styled-components/styled-components) instead.\n\n## Installation\n\n```bash\nnpm i mini-styled\n```\nor if you're using yarn\n```bash\nyarn add mini-styled\n```\n\n## Example\n\n```jsx\nimport React from 'react';\n\nimport styled from 'mini-styled';\n\nconst Wrapper = styled.section`\n  padding: 24px;\n  background: papayawhip;\n`;\n\nconst Button = styled.button`\n  background-color: ${props =\u003e props.customBg || 'white'};\n  color: palevioletred;\n  border: 24px;\n\n  \u0026:hover {\n    background-color: pink;\n  }\n`;\n\nconst MyComponent = () =\u003e (\n  \u003cWrapper\u003e\n    \u003cButton customBg=\"yellow\"\u003eClick me\u003c/Button\u003e\n  \u003c/Wrapper\u003e\n);\n```\nAnd then you'll see this in your project:\n\n![image](https://user-images.githubusercontent.com/28108272/132994589-7b1c3c9d-9396-479e-8efd-79b4fa13cead.png)\n\n## API\n\nThe existing API at this moment expose only the `styled` factory, which works for HTML Elements and React Components, just as styled.\nIt supports media queries, pseudo classes and general features oferred by [Stylis.js](https://stylis.js.org/). Check [TODO](#todo) for planned functionalities.\n\n## TODO\n\n- [ ] Add tests\n- [ ] Make proper use of [stylis middleware](https://github.com/thysultan/stylis.js#middleware) to inject rules via CSSOM\n- [ ] Add vendor prefixes (also from stylis)\n- [ ] Make it work natively with SSR\n\nFeel free to contribute to this project, to increase its features, improve its code and etc!\nAnd although this isn't a project I'm willing to take too seriously, feel free to report issues, I'll take a look as soon as possible.\n\n## Acknowledgements\n- Special thanks to [Josh](https://twitter.com/JoshWComeau).\n\nI started this project by navigating and studying styled-components source, but his post on [Demystifying styled-components](https://www.joshwcomeau.com/react/demystifying-styled-components/) really gave me some insights that I applied to the final structure of the code for the sake of simplicity :)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoelhucas%2Fmini-styled","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoelhucas%2Fmini-styled","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoelhucas%2Fmini-styled/lists"}