{"id":19451187,"url":"https://github.com/thekashey/styled-components-mixins","last_synced_at":"2025-08-02T10:13:22.511Z","repository":{"id":57373296,"uuid":"100787422","full_name":"theKashey/styled-components-mixins","owner":"theKashey","description":"Use popular frameworks with Styled Components","archived":false,"fork":false,"pushed_at":"2018-05-27T07:38:03.000Z","size":108,"stargazers_count":30,"open_issues_count":2,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-04T01:04:59.885Z","etag":null,"topics":["css","react","styled-components"],"latest_commit_sha":null,"homepage":null,"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/theKashey.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":"2017-08-19T10:33:03.000Z","updated_at":"2022-04-04T12:46:59.000Z","dependencies_parsed_at":"2022-08-30T00:40:53.249Z","dependency_job_id":null,"html_url":"https://github.com/theKashey/styled-components-mixins","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/theKashey/styled-components-mixins","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theKashey%2Fstyled-components-mixins","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theKashey%2Fstyled-components-mixins/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theKashey%2Fstyled-components-mixins/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theKashey%2Fstyled-components-mixins/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/theKashey","download_url":"https://codeload.github.com/theKashey/styled-components-mixins/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theKashey%2Fstyled-components-mixins/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268370180,"owners_count":24239766,"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","status":"online","status_checked_at":"2025-08-02T02:00:12.353Z","response_time":74,"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":["css","react","styled-components"],"created_at":"2024-11-10T16:40:40.419Z","updated_at":"2025-08-02T10:13:22.481Z","avatar_url":"https://github.com/theKashey.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"This project is a part of `*-mixins`, with goal to provide a better __CSS__ experience\n to the __React__ infected people.\n## Install\n[![NPM](https://nodei.co/npm/styled-components-mixins.png?downloads=true\u0026stars=true)](https://nodei.co/npm/styled-components-mixins/)\n\n## Use\n```js\n // import classes you need from the library you need.\n import {class1, class2} from 'styled-components-mixins/{LIBRARY}';\n // use them as mixins\n const Component = styled.div`\n    ${class1}\n    z-index: 1;\n `;\n```\n\n## Includes:\n - https://github.com/tachyons-css/tachyons/\n - https://github.com/twbs/bootstrap\n - https://github.com/turretcss/turretcss\n - https://github.com/Dogfalo/materialize\n - https://github.com/monarkee/beard\n - https://github.com/basscss/basscss\n \n \nif you need more - raise an issue, open a PR, or use webpack`s [css-to-js-loader](https://github.com/theKashey/css-to-js-loader).\n \n# Demo \n[![Edit Styled Components](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/qkv82lk6l6)\n\n# Theory\nAtomic (or Functional) css is quite good methodology, \nbut as long it solves many issues - it also introduces a new one.\n\nYou can create a Button, and you can describe how it must look like.\n```js\n\u003cbutton class=\"bg-purple f6 br3 ph3 pv2 white hover-bg-light-purple\"\u003e\n  Button Text\n\u003c/button\u003e\n```  \nBut you will soil HTML code with details of behavior. Both css driven by html or html driven by css is bad.\nSomething in the middle - BEM - is also not very usable.\n\nYou can use LESS to combine all modificators, to have single control point \n```less\n.bg-purple{\n  .f6;\n  .br3; \n  .ph3; \n  .pv2; \n  .white;  \n  .hover-bg-light-purple;\n}\n```\nBut result CSS will be HUGE.\n\nBut you can use client-side CSS framework, to do the same. To get a `Component`. And you will love the result.\n```js\nconst Button = styled.button`\n  ${f6};\n  ${br3}; \n  ${ph3}; \n  ${pv2}; \n  ${white};  \n  ${hover-bg-light-purple};\n`\n```\n\n# Limitations\n *-Mixins can provide only __mixins__. A single class, style, or an atom.\n \n If some library has selector like:\n```css\n  .someclass .someanotherClass\n```\n *-Mixins will provide only .someclass, and adding .someanotherClass to the html markup - is your duty.\n No magic.\n\n# Naming conversion\n One cannot use real `css` names in js, so we have to convert names to a js-friendly format:\n - \".class\" becomes class\n - \"tag\" becomes tag_tag\n - \"#id\" becomes $id\n - \"hover-bg\" becomes hover_bg\n - \"block--element\" becomes block$$element\n - \".class.anotherclass\" becomes class_and_anotherclass  \n\n# Prior art\n \nIdea was found here - https://adamwathan.me/css-utility-classes-and-separation-of-concerns/\n\nThis is just an adoptation for a different style of CSS generation.\n\n![idea](http://kashey.ru/img/classMixins.gif)\n\n# Licence\n MIT","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthekashey%2Fstyled-components-mixins","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthekashey%2Fstyled-components-mixins","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthekashey%2Fstyled-components-mixins/lists"}