{"id":25448891,"url":"https://github.com/rgdelato/styled-classnames","last_synced_at":"2025-11-02T01:30:28.877Z","repository":{"id":57373276,"uuid":"79611656","full_name":"rgdelato/styled-classnames","owner":"rgdelato","description":"styled-components without the components","archived":false,"fork":false,"pushed_at":"2018-07-17T19:06:41.000Z","size":42,"stargazers_count":27,"open_issues_count":2,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-03-14T17:14:18.559Z","etag":null,"topics":["css","css-in-js","styled-classnames","styled-components"],"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/rgdelato.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-01-21T00:12:46.000Z","updated_at":"2024-03-14T17:14:18.560Z","dependencies_parsed_at":"2022-08-29T14:42:20.129Z","dependency_job_id":null,"html_url":"https://github.com/rgdelato/styled-classnames","commit_stats":null,"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rgdelato%2Fstyled-classnames","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rgdelato%2Fstyled-classnames/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rgdelato%2Fstyled-classnames/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rgdelato%2Fstyled-classnames/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rgdelato","download_url":"https://codeload.github.com/rgdelato/styled-classnames/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239132557,"owners_count":19587106,"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","css-in-js","styled-classnames","styled-components"],"created_at":"2025-02-17T20:15:39.952Z","updated_at":"2025-11-02T01:30:28.800Z","avatar_url":"https://github.com/rgdelato.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Warning: This library is no longer being maintained!\nI would strongly recommend using another CSS-in-JS library, such as [Emotion](https://emotion.sh/)\n\n# styled-classnames\nUse [`styled-components`](https://github.com/styled-components/styled-components) without the components!\n\n...it's a short hack that still uses `styled-components` under the hood, so all the credit for this goes to [Glen Maddern](https://twitter.com/glenmaddern), [Max Stoiber](https://twitter.com/mxstbr), and the `styled-components` community.\n\nBe aware that including `styled-classnames` adds a noticeable amount to your final JS bundle size.\n\n## Javascript\n\n[![npm version](https://img.shields.io/npm/v/styled-classnames.svg?style=flat)](https://www.npmjs.com/package/styled-classnames) \n\n```\nnpm install --save-dev styled-classnames\n```\n\n```javascript\nimport React from \"react\";\nimport Link from \"react-router/Link\";\nimport styled from \"styled-classnames\";\n\nconst linkClassName = styled`\n  color: ${props =\u003e props.color};\n  margin: 3px;\n  padding: 3px 7px;\n  text-decoration: none;\n  border: 1px solid transparent;\n  border-radius: 3px;\n\n  \u0026:hover { border-color: rgba(175, 47, 47, 0.1); }\n`;\n\nconst activeClassName = styled`\n  border-color: rgba(175, 47, 47, 0.2);\n`;\n\nconst FilterLink = (props) =\u003e {\n  return (\n    \u003cLink\n      {...props}\n      className={linkClassName(props)}\n      activeClassName={activeClassName(props)}\n    /\u003e\n  );\n};\n\nexport default FilterLink;\n```\n\n## ClojureScript\n\n[![Clojars Project](https://img.shields.io/clojars/v/cljsjs/styled-classnames.svg)](https://clojars.org/cljsjs/styled-classnames)\n\n```clojure\n(ns demo.core\n    (:require [reagent.core :as reagent]\n              cljsjs.styled-classnames))\n\n(def font-family (atom \"Baskerville\"))\n\n(def home-class (js/styled \"\n  font-size: 72px;\n  font-family: \" @font-family \";\n  font-style: italic;\n  color: \" #(:color %) \";\n\"))\n\n(defn home-page []\n  [:div\n    [:h2 {:class (home-class {:color \"rebeccapurple\"})}\n      \"Welcome to Reagent\"]])\n```\n\n## Details\nHelper methods from `styled-components` are also exposed:\n```javascript\nimport styled, { css, keyframes, injectGlobal } from \"styled-classnames\";\n```\n\nNote that `ThemeProvider` and `withTheme` are React-specific and are not included in this library. If you need them, you can still import them from `styled-components`, or if you know how context works in React, you could write them yourself.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frgdelato%2Fstyled-classnames","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frgdelato%2Fstyled-classnames","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frgdelato%2Fstyled-classnames/lists"}