{"id":18556764,"url":"https://github.com/urbit/foundation-design-system","last_synced_at":"2025-04-10T01:31:34.488Z","repository":{"id":37359759,"uuid":"503983967","full_name":"urbit/foundation-design-system","owner":"urbit","description":"A system of design variables, Markdoc and React components intended for Urbit Foundation projects.","archived":false,"fork":false,"pushed_at":"2023-09-22T00:56:03.000Z","size":6045,"stargazers_count":4,"open_issues_count":4,"forks_count":1,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-02T00:16:08.275Z","etag":null,"topics":[],"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/urbit.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-06-16T02:21:33.000Z","updated_at":"2025-02-07T06:20:36.000Z","dependencies_parsed_at":"2024-11-06T21:36:28.373Z","dependency_job_id":"82a61d11-d7a9-463c-92c5-d786abc52033","html_url":"https://github.com/urbit/foundation-design-system","commit_stats":{"total_commits":141,"total_committers":5,"mean_commits":28.2,"dds":0.03546099290780147,"last_synced_commit":"5a148702ae40b4ad15d90690dcae4d1cb4fa5c76"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/urbit%2Ffoundation-design-system","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/urbit%2Ffoundation-design-system/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/urbit%2Ffoundation-design-system/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/urbit%2Ffoundation-design-system/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/urbit","download_url":"https://codeload.github.com/urbit/foundation-design-system/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248045222,"owners_count":21038553,"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-06T21:33:12.511Z","updated_at":"2025-04-10T01:31:29.475Z","avatar_url":"https://github.com/urbit.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @urbit/foundation-design-system\nA system of design variables, Markdoc and React components intended for Urbit Foundation projects.\n\n## Usage\n\nWe build all our sites with [Next.js](https://nextjs.org) and [Tailwind](https://tailwindcss.com) and this package is designed for those scenarios. Please be advised you will need a Next.js installation to make use of these components.\n\n```bash\nnpm i @urbit/foundation-design-system\n```\n\nEnsure all peer dependencies are present as well:\n\n```bash\nnpm i @tailwindcss/aspect-ratio tailwindcss-theme-swapper autoprefixer postcss prismjs tailwindcss next\n```\n\n### Tailwind config and other CSS styles\n\nOur design variables are available by using the Tailwind config in your own installation as a preset, ensuring you style our components as well in the `content` section:\n\n```js\npresets: [require(\"@urbit/foundation-design-system/tailwind\")],\ncontent: [\n  \"./node_modules/@urbit/foundation-design-system/**/*.js\",\n  \"./pages/**/*.{js,ts,jsx,tsx}\",\n  \"./components/**/*.{js,ts,jsx,tsx}\",\n],\n```\n\nLikewise you can find our CSS styles by importing them at the top of your site build (i.e. `_app.js`):\n\n```js\nimport \"@urbit/foundation-design-system/styles/globals.css\";\nimport \"@urbit/foundation-design-system/styles/markdown.css\";\nimport \"@urbit/foundation-design-system/styles/prism.css\";\n```\n\n### Markdown parser, renderer, and components\n\nWe use [Markdoc](https://markdoc.io) to allow for embedding dynamic React components inside Markdown files. For a sample of our components and how to use them in your own Markdown, see [here](MARKDOWN.md).\n\nOur Markdown parser is a custom patched installation of Markdoc for additional features (basic footnote support, superscript, next/link injection, inline HTML injection).\n\nImport the component:\n\n```js\nimport Markdown from '@urbit/foundation-design-system'; \n```\n\nThen, on the server-side parse your content by passing it an object in the following shape:\n\n```js\n{ post: { content: \"## A markdown document\"}}\n```\n\nIf you've extracted the `content` directly with `gray-matter` reconstruct the object:\n\n```js\nconst markdown = JSON.stringify(Markdown.parse({ post: { content } }));\n```\n\nOtherwise this works fine if you're just using `getPostBySlug` a la urbit.org:\n\n```js\nconst markdown = JSON.stringify(Markdown.parse(post));\n```\n\nAnd on front-end pass it to the renderer:\n\n```jsx\n\u003cdiv className=\"markdown\"\u003e\n    \u003cMarkdown.render content={JSON.parse(markdown)} /\u003e\n\u003c/div\u003e\n```\n\n*Why are we doing JSON stringification and parsing?* you ask. The wind answers, and you feel the breeze on the back of your neck.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Furbit%2Ffoundation-design-system","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Furbit%2Ffoundation-design-system","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Furbit%2Ffoundation-design-system/lists"}