{"id":26751062,"url":"https://github.com/ghalex/vue-sx","last_synced_at":"2025-08-01T18:12:10.133Z","repository":{"id":44543006,"uuid":"489606696","full_name":"ghalex/vue-sx","owner":"ghalex","description":"vue-sx is a simple library that allows you to write clean CSS-in-JS for Vue","archived":false,"fork":false,"pushed_at":"2022-10-21T07:49:03.000Z","size":176,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-19T12:48:23.482Z","etag":null,"topics":["emotion","styled-system","vue","vue3"],"latest_commit_sha":null,"homepage":"","language":"Vue","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ghalex.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-05-07T07:47:24.000Z","updated_at":"2023-08-23T01:44:17.000Z","dependencies_parsed_at":"2023-01-20T06:45:53.911Z","dependency_job_id":null,"html_url":"https://github.com/ghalex/vue-sx","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ghalex/vue-sx","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghalex%2Fvue-sx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghalex%2Fvue-sx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghalex%2Fvue-sx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghalex%2Fvue-sx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ghalex","download_url":"https://codeload.github.com/ghalex/vue-sx/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghalex%2Fvue-sx/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268273041,"owners_count":24223790,"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-01T02:00:08.611Z","response_time":67,"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":["emotion","styled-system","vue","vue3"],"created_at":"2025-03-28T12:16:22.950Z","updated_at":"2025-08-01T18:12:09.647Z","avatar_url":"https://github.com/ghalex.png","language":"Vue","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003eVueSx\u003c/h1\u003e\n\u003ch3 align=\"center\"\u003eCSS-in-JS for Vue\u003c/h3\u003e\n\u003cp align=\"center\"\u003e\n\u003cb\u003evue-sx\u003c/b\u003e is a simple library that allows you to write clean CSS-in-JS for Vue\n\u003c/p\u003e\n\n\n\u003cp align=\"center\"\u003e\n\u003ca title=\"Total downloads\" href=\"https://www.npmjs.com/package/vue-sx\"\u003e\n    \u003cimg src=\"https://img.shields.io/npm/dm/vue-sx.svg?style=flat-square\"\u003e\n  \u003c/a\u003e\n  \u003ca title=\"Current version\" href=\"https://www.npmjs.com/package/vue-sx\"\u003e\n    \u003cimg src=\"https://img.shields.io/npm/v/vue-sx.svg?style=flat-square\"\u003e\n  \u003c/a\u003e\n  \u003ca title=\"MIT License\" href=\"LICENSE\"\u003e\n    \u003cimg alt=\"GitHub\" src=\"https://img.shields.io/github/license/ghalex/vue-sx?style=flat-square\"\u003e\n  \u003c/a\u003e\n  \u003cbr\u003e\n  \u003cbr\u003e\n\u003c/p\u003e\n\n## Introduction\n\nvue-sx is using [styled-system](https://styled-system.com/) and [emotion](emotion.sh) to allow you to write simple and clean css-in-js for Vue components. Inspired by `sx` prop from [@mui/material\n](https://mui.com/system/basics/#the-sx-prop)\n\nSome of the key features are:\n- Customize styles inline with the `sx` prop\n- Ergonomic responsive array-based values\n- [Styled System](https://styled-system.com/) props\n- Themeable and compatible with the [Theme Specification](https://styled-system.com/theme-specification)\n- Built with [Emotion](emotion.sh) css prop\n\n## Getting Started\n\n```sh\nnpm i vue-sx\n```\n\n```vue\n\u003cscript\u003e\nimport { defineComponent } from 'vue'\nimport { Box, styled } from 'vue-sx'\n\nconst Custom = styled('div')({\n  border: '1px solid red',\n  bg: 'purple',\n  color: 'white',\n  m: [5, 3, 0]\n})\n\nexport default defineComponent({\n  components: { Box, Custom }\n})\n\u003c/script\u003e\n\n\u003ctemplate\u003e\n  \u003cCustom\u003e\n    \u003cBox\n      sx={{\n        bg: (theme) =\u003e theme.colors.primary,\n        color: 'white',\n        p: 2, // theme.space[2],\n        mt: 2 \n      }}\n      as=\"button\"\n      \u003e\n      Click me\n    \u003c/Box\u003e\n  \u003c/Custom\u003e\n\u003c/template\u003e\n```\n\n### `sx` Prop\n\nThe `Box` components accepts a `sx` prop that works with no additional setup required.\n\nThe `sx` prop is similar to Emotion's `css` prop, but allows you to use values derived from the theme object.\n\nBox follows the [Theme Specification](), which means that any theme created for use with [Theme UI](), [Styled System](), or other similar libraries will work out-of-the-box.\n\nThis allows you to share design constraints for typography, color, and layout throughout your application using a theming context.\n\n```vue\n\u003cBox\n  :sx=\"{\n    p: 4,\n    color: 'primary',\n  }\"\n/\u003e\n```\n\n## Theming\n\nTo add a theme to an application, import the `ThemeProvider` component from `vue-sx` and pass a custom theme object in.\n\n```vue\n\u003cscript\u003e\nimport { ref, defineComponent } from 'vue'\nimport { Box, ThemeProvider } from 'vue-sx'\n\nconst theme = {\n  breakpoints: [\n    '40em', '52em', '64em',\n  ],\n  colors: {\n    text: '#000',\n    background: '#fff',\n    primary: '#07c',\n  },\n  space: [\n    0, 4, 8, 16, 32, 64, 128, 256,\n  ],\n}\n\nexport default defineComponent({\n  components: { Box, Custom },\n  setup() {\n    const currentTheme = ref(theme)\n    return { currentTheme }\n  }\n})\n\u003c/script\u003e\n\n\u003ctemplate\u003e\n  \u003cThemeProvider :theme=\"currentTheme\"\u003e\n    \u003cBox\n      :sx=\"{\n        border: '1px solid red',\n        bg: theme =\u003e theme.colors.primary,\n        p: 4,\n        mr: 4\n      }\"\u003e\n      It works\n    \u003c/Box\u003e\n  \u003c/ThemeProvider\u003e\n\u003c/template\u003e\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fghalex%2Fvue-sx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fghalex%2Fvue-sx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fghalex%2Fvue-sx/lists"}