{"id":27048850,"url":"https://github.com/xcfox/emotion-sugar","last_synced_at":"2025-07-04T10:33:47.801Z","repository":{"id":57676249,"uuid":"485885099","full_name":"xcfox/emotion-sugar","owner":"xcfox","description":"🍭 A set of pleasant utilities for emotion","archived":false,"fork":false,"pushed_at":"2023-04-14T09:45:07.000Z","size":604,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-21T06:36:32.344Z","etag":null,"topics":["atomic-css","css","css-in-js","emotion","react","utility-first"],"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/xcfox.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":"2022-04-26T17:30:37.000Z","updated_at":"2022-04-29T15:52:41.000Z","dependencies_parsed_at":"2023-01-25T05:30:19.356Z","dependency_job_id":null,"html_url":"https://github.com/xcfox/emotion-sugar","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/xcfox/emotion-sugar","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xcfox%2Femotion-sugar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xcfox%2Femotion-sugar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xcfox%2Femotion-sugar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xcfox%2Femotion-sugar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xcfox","download_url":"https://codeload.github.com/xcfox/emotion-sugar/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xcfox%2Femotion-sugar/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263493329,"owners_count":23475176,"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":["atomic-css","css","css-in-js","emotion","react","utility-first"],"created_at":"2025-04-05T07:16:37.576Z","updated_at":"2025-07-04T10:33:47.772Z","avatar_url":"https://github.com/xcfox.png","language":"TypeScript","readme":"# Emotion Sugar\n\n🍭 A set of pleasant utilities for emotion\n\n[![License](https://img.shields.io/npm/l/emotion-sugar.svg)](https://github.com/xcfox/emotion-sugar/blob/main/LICENSE)\n[![npm](https://img.shields.io/npm/v/emotion-sugar.svg)](https://www.npmjs.com/package/emotion-sugar)\n[![NPM Downloads](https://img.shields.io/npm/dm/emotion-sugar.svg?style=flat)](https://www.npmjs.com/package/emotion-sugar)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n\n[Emotion](https://github.com/emotion-js/emotion) is a performant and flexible CSS-in-JS library.  \nThis Library provides a set of utilities for emotion, or rather, it makes emotion utility-first.\n\n## 🧋 Let's make emotion more delight\n\nWrite style with emotion:\n\n```tsx\nimport { css, jsx } from '@emotion/react'\n\nconst color = 'white'\n\nrender(\n  \u003cdiv\n    css={css`\n      padding: 32px;\n      background-color: hotpink;\n      font-size: 24px;\n      border-radius: 4px;\n      \u0026:hover {\n        color: ${color};\n      }\n    `}\n  \u003e\n    Hover to change color.\n  \u003c/div\u003e\n)\n```\n\nWrite style with emotion and add some sugar:\n\n```tsx\nimport { jsx } from '@emotion/react'\nimport { p, color } from 'emotion-sugar'\n\nconst textColor = 'white'\n\nrender(\n  \u003cdiv css={p(32).bg('hotpink').text(24).rounded(4).hover(color(textColor))}\u003e\n    Hover to change color.\n  \u003c/div\u003e\n)\n```\n\n## 🌠 Features\n\n**🧩 Seamless integration with emotion：** Use it in existing emotion projects as you like.  \n**🛡️ Typed:** Full support for TypeScript  \n**🍸 Less code:** It is far less code than native css  \n**🍩 Flex tooltips:** Let's make a flex container by intuition\n\n## 🔧 Install\n\nuse yarn:\n\n```sh\nyarn add @emotion/react emotion-sugar\n```\n\nor use npm:\n\n```sh\nnpm i @emotion/react emotion-sugar\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxcfox%2Femotion-sugar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxcfox%2Femotion-sugar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxcfox%2Femotion-sugar/lists"}