{"id":19451225,"url":"https://github.com/thekashey/css-to-js-loader","last_synced_at":"2026-04-29T21:05:43.519Z","repository":{"id":57210944,"uuid":"100794084","full_name":"theKashey/css-to-js-loader","owner":"theKashey","description":"Transforms your CSS to the `real` JS","archived":false,"fork":false,"pushed_at":"2018-05-27T07:30:47.000Z","size":4,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-19T17:46:59.576Z","etag":null,"topics":["css","react","styled-components","webpack-loader"],"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-19T12:52:52.000Z","updated_at":"2021-06-15T09:00:59.000Z","dependencies_parsed_at":"2022-09-01T04:22:43.083Z","dependency_job_id":null,"html_url":"https://github.com/theKashey/css-to-js-loader","commit_stats":null,"previous_names":["thekashey/css-to-js-webpack-plugin"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theKashey%2Fcss-to-js-loader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theKashey%2Fcss-to-js-loader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theKashey%2Fcss-to-js-loader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theKashey%2Fcss-to-js-loader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/theKashey","download_url":"https://codeload.github.com/theKashey/css-to-js-loader/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240638818,"owners_count":19833360,"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","react","styled-components","webpack-loader"],"created_at":"2024-11-10T16:40:48.651Z","updated_at":"2026-04-29T21:05:38.477Z","avatar_url":"https://github.com/theKashey.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"CSS-in-JS? Not yet.\n\nMost of libraries just create stylesheets for you. From pure CSS or pure JS code.\n \n[![NPM](https://nodei.co/npm/css-to-js-loader.png?downloads=true\u0026stars=true)](https://nodei.co/npm/css-to-js-loader/) \n \n# CSS-to-JS\nThis webpack loader actually __converts CSS code__ into the __JavaScript__.\nNot just provide classNames, but wraps everything with client-side CSS-in-JS libraries. \n\n## Supported APIs\n - Styled-Components \n \n### Example\nGiven css:\n```css\n.h1 {\n    color: #F00;\n}\n\n.P {\n    font-size: 14px;\n    color: #0F0;\n    --css-to-js-component: div;\n}\n```\nAnd JS \n```js\nimport { h1, P } from '!css-to-js-loader!./style.css'\n\n// h1 is styled.css\n// you can use h1 as mixin\nconst H1 = styled.div`${h1};`;\n\n\n// and P is the real styled-component\nconst App = () =\u003e \u003cP\u003eI am Component!\u003c/P\u003e   \n```\n\nThus allows you to write more modular code. And keep all CSS inside CSS.\n\n### mixins\n\n```css\n.h {\n    font-size: 10px;\n}\n\n.h1 {\n    --css-in-js-mixin: \".h\"; /** same as LESS mixins. In css way **/\n    color: #F00;\n}\n``` \n\n# Existing CSS libraries.\n To manage existing libraries see *-mixins\n - [styled-components-mixins](https://github.com/theKashey/styled-components-mixins)\n\n# Licence\n MIT","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthekashey%2Fcss-to-js-loader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthekashey%2Fcss-to-js-loader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthekashey%2Fcss-to-js-loader/lists"}