{"id":19251357,"url":"https://github.com/springtype-org/st-jss","last_synced_at":"2025-07-21T18:32:21.360Z","repository":{"id":57369091,"uuid":"337021082","full_name":"springtype-org/st-jss","owner":"springtype-org","description":"~600 byte nano library to work with CSS in TS","archived":false,"fork":false,"pushed_at":"2021-09-14T23:40:04.000Z","size":447,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-04-22T21:22:04.232Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/springtype-org.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2021-02-08T09:22:35.000Z","updated_at":"2021-09-14T23:37:26.000Z","dependencies_parsed_at":"2022-09-15T21:31:07.259Z","dependency_job_id":null,"html_url":"https://github.com/springtype-org/st-jss","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/springtype-org%2Fst-jss","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/springtype-org%2Fst-jss/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/springtype-org%2Fst-jss/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/springtype-org%2Fst-jss/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/springtype-org","download_url":"https://codeload.github.com/springtype-org/st-jss/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240347763,"owners_count":19787230,"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":[],"created_at":"2024-11-09T18:22:02.076Z","updated_at":"2025-02-23T16:40:47.743Z","avatar_url":"https://github.com/springtype-org.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003eSpringType: st-jss\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  Nano library to work with CSS in TS\n\u003c/p\u003e\n\n[![Gitter](https://badges.gitter.im/springtype-official/springtype.svg)](https://gitter.im/springtype-official/springtype?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge)\n\n\u003ch2 align=\"center\"\u003ePurpose\u003c/h2\u003e\n\nThis is an exremely tiny, yet powerful library for generation of CSS in TypeScript. `st-jss` does include all special types like _font-face_, _keyframes_, `@media` queries and `:pseudo-selectors`.\n\n\u003ch2 align=\"center\"\u003eFeatures\u003c/h2\u003e\n\n- ✅ Implements a JSS-like API to work with CSS in TS\n- ✅ Comes with namespace support\n- ✅ Tiny: `591 bytes` (best, brotli) - `781 bytes` (worst, umd, gz)\n- ✅ Zero dependencies\n- ✅ First class TypeScript support\n- ✅ 99% Unit Test coverage\n\n\u003ch2 align=\"center\"\u003eHow to\u003c/h2\u003e\n\nThis is how using `st-jss` looks like:\n\n```tsx\nimport {Props, tsx, render} from \"springtype\";\nimport { jss } from 'st-jss';\n\nexport const MyStyledCmp = ({ children }: Props) =\u003e {\n  const [animationName, animationStyle] = jss.makeAnimation('myAnimation', {\n    '0%': { top: 0, left: 0, background: 'red' },\n    '25%': { top: 0, left: 100, background: 'blue' },\n    '50%': { top: 100, left: 100, background: 'yellow' },\n    '75%': { top: 100, left: 0, background: 'green' },\n    '100%': { top: 0, left: 0, background: 'red' },\n  });\n\n  const [classes, style] = jss.makeStyles({\n    container: {\n      // Normal jss\n      fontFamily: 'Nonito',\n      '@media (min-device-width: 800px)': {\n        paddingTop: 50,\n        flex: 1,\n        ':hover': {\n          backgroundColor: 'red',\n        },\n      },\n    },\n    animation: {\n      paddingTop: 50,\n      animationName,\n      animationIterationCount: 'infinite',\n      animationDuration: '4s',\n    },\n  });\n\n  const onChangeStyleClick = () =\u003e {\n    console.log('ref?', style);\n  };\n\n  return (\n    \u003cfragment\u003e\n      {style}\n      {animationStyle}\n      \u003cdiv className={classes.container}\u003e{children}\u003c/div\u003e\n      \u003cdiv className={classes.animation} /\u003e\n      \u003cbutton type=\"button\" onClick={onChangeStyleClick}\u003e\n        Change style\n      \u003c/button\u003e\n    \u003c/fragment\u003e\n  );\n};\n\nrender(\u003cMyStyledCmp /\u003e);\n```\n\n\u003ch2 align=\"center\"\u003eAPI\u003c/h2\u003e\n\nThe following contract is made between the webapp and `st-jss`:\n\n```typescript\nexport interface API {\n  classNamePrefix: string;\n  instanceCounter: number;\n  makeFont: (style: FontFaceProperties) =\u003e IVirtualNode;\n  makeAnimation: (animationName: string, style: KeyFrameProperties) =\u003e [string, IVirtualNode];\n  makeStyles: \u003cT extends string = string\u003e(classProperty: ClassProperty\u003cT\u003e) =\u003e [Record\u003cT, string\u003e, IVirtualNode];\n}\n```\n\n\u003ch2 align=\"center\"\u003eBackers\u003c/h2\u003e\n\nThank you so much for supporting us financially! 🙏🏻😎🥳👍\n\n\u003ctable\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003ctd align=\"center\"\u003e\n        \u003cimg width=\"150\" height=\"150\"\n        src=\"https://avatars2.githubusercontent.com/u/17221813?v=4\u0026s=150\"\u003e\n        \u003c/br\u003e\n        \u003ca href=\"https://github.com/jsdevtom\"\u003eTom\u003c/a\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n  \u003ctbody\u003e\n\u003c/table\u003e\n\n\u003ch2 align=\"center\"\u003eMaintainers\u003c/h2\u003e\n\n`st-jss` is brought to you by:\n\n\u003ctable\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003ctd align=\"center\"\u003e\n        \u003cimg width=\"150\" height=\"150\"\n        src=\"https://avatars2.githubusercontent.com/u/12079044?s=150\u0026v=4\"\u003e\n        \u003c/br\u003e\n        \u003ca href=\"https://github.com/mansi1\"\u003eMichael Mannseicher\u003c/a\u003e\n      \u003c/td\u003e\n      \u003ctd align=\"center\"\u003e\n        \u003cimg width=\"150\" height=\"150\"\n        src=\"https://avatars3.githubusercontent.com/u/454817?v=4\u0026s=150\"\u003e\n        \u003c/br\u003e\n        \u003ca href=\"https://github.com/kyr0\"\u003eAron Homberg\u003c/a\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n  \u003ctbody\u003e\n\u003c/table\u003e\n\n\u003ch2 align=\"center\"\u003eContributing\u003c/h2\u003e\n\nPlease help out to make this project even better and see your name added to the list of our\n[CONTRIBUTORS.md](./CONTRIBUTORS.md) :tada:\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspringtype-org%2Fst-jss","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspringtype-org%2Fst-jss","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspringtype-org%2Fst-jss/lists"}