|
| 1 | +--- |
| 2 | +banner: ./images/banner.png |
| 3 | +slug: contribute-to-sandpack-in-hacktoberfest |
| 4 | +authors: ['Adewale Abati'] |
| 5 | +photo: https://avatars0.githubusercontent.com/u/4003538?s=460&v=4 |
| 6 | +title: Contribute to Sandpack in Hacktoberfest |
| 7 | +description: |
| 8 | + Empower developers with custom live coding experiences by contributing new |
| 9 | + themes to Sandpack . |
| 10 | +date: 2022-09-30 |
| 11 | +--- |
| 12 | + |
| 13 | +At CodeSandbox, we are excited for [Hacktoberfest](https://hacktoberfest.com/) and all the value that open |
| 14 | +source contributions generate at this time of the year for exciting open source |
| 15 | +projects, the maintainers and contributors. |
| 16 | + |
| 17 | +We are thrilled to also share that we’ve added the `hacktoberfest` topic to |
| 18 | +Sandpack and would love your contributions. |
| 19 | + |
| 20 | +## Contributing Sandpack themes |
| 21 | + |
| 22 | +Our key goal is empowering developers to include custom live coding experiences |
| 23 | +on the web, regardless of your website layout or level of design or expertise. |
| 24 | +To be able to do this, we have provided plenty of options under |
| 25 | +[`@codesandbox/sandpack-themes`](https://sandpack.codesandbox.io/docs/getting-started/themes), and we want to offer even more options from the |
| 26 | +community. |
| 27 | + |
| 28 | +So, how can you contribute to new themes? |
| 29 | + |
| 30 | +### **Sandpack Theme Builder** |
| 31 | + |
| 32 | +Sandpack provides a tool to guide you in creating your custom theme. Start with |
| 33 | +a dark or light theme, and then add your custom values like primary and |
| 34 | +secondary colors. |
| 35 | + |
| 36 | +Plus, if you want to give it an even more personal touch, you can go to the |
| 37 | +Advanced tab and set colors for the syntax highlight and other cases. |
| 38 | +[https://sandpack.codesandbox.io/theme](https://sandpack.codesandbox.io/theme) |
| 39 | + |
| 40 | + |
| 41 | + |
| 42 | +### **Publish a theme** |
| 43 | + |
| 44 | +At this point, you need to go to the Sandpack repository, fork it, and introduce |
| 45 | +some changes in your pull request. The easiest way to do this is to use |
| 46 | +CodeSandbox Projects: |
| 47 | + |
| 48 | +1. Open the Sandpack repository on |
| 49 | + [CodeSandbox Projects](https://codesandbox.io/p/github/codesandbox/sandpack/main?file=%2FREADME.md). |
| 50 | +2. Create a contribution branch, which will fork the repository for you: |
| 51 | + |
| 52 | + |
| 53 | + |
| 54 | +3. Create a new file in |
| 55 | + the [codesandbox/sandpack/sandpack-themes/src](https://github.com/codesandbox/sandpack/tree/main/sandpack-themes/src) folder |
| 56 | + with the following name `[myAwesomeTheme].ts` |
| 57 | +4. The content of this file must be an export for an object that contains the |
| 58 | + theme: |
| 59 | + |
| 60 | +```js |
| 61 | +import type { SandpackTheme } from "./types"; |
| 62 | + |
| 63 | +export const myAwesomeTheme: SandpackTheme = { |
| 64 | + colors: { |
| 65 | + ... |
| 66 | + }, |
| 67 | + |
| 68 | + syntax: { |
| 69 | + ... |
| 70 | + }, |
| 71 | + |
| 72 | + font: { |
| 73 | + ... |
| 74 | + }, |
| 75 | +}; |
| 76 | + |
| 77 | +``` |
| 78 | + |
| 79 | +1. Include your new theme into |
| 80 | + the [index.ts](https://github.com/codesandbox/sandpack/blob/main/sandpack-themes/src/index.ts) |
| 81 | + file, which exposes all themes. |
| 82 | +2. Commit and send in your pull request. Done 🚀 |
| 83 | + |
| 84 | +We cannot wait to see the amazing themes from the community. And if you have any |
| 85 | +questions or want to reach out to the team, feel free to contact us on |
| 86 | +[Discord](https://discord.gg/C6vfhW3H6e) or on |
| 87 | +[GitHub](https://github.com/codesandbox/sandpack/issues). |
| 88 | + |
| 89 | +Happy contributing! 🎉 |
0 commit comments