Skip to content

Commit 5d46ad5

Browse files
acekyddanilowoz
andauthored
Publishing Sandpack hacktoberfest blogpost. (#6953)
* Publish Sandpack hacktoberfest article * Update index.md and _post.elements.js * Update packages/homepage/content/articles/contribute-sandpack-hacktoberfest/index.md Co-authored-by: Danilo Woznica <[email protected]> * Update packages/homepage/content/articles/contribute-sandpack-hacktoberfest/index.md Co-authored-by: Danilo Woznica <[email protected]> * Update packages/homepage/content/articles/contribute-sandpack-hacktoberfest/index.md Co-authored-by: Danilo Woznica <[email protected]> Co-authored-by: Danilo Woznica <[email protected]>
1 parent 98b0afb commit 5d46ad5

File tree

5 files changed

+182
-0
lines changed

5 files changed

+182
-0
lines changed
90.3 KB
Loading
37.3 KB
Loading
388 KB
Loading
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
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+
![sandpack-theme-builder.gif](./images/sandpack-theme-builder.gif)
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+
![Contribution branch](./images/contribution-branch.png)
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! 🎉

packages/homepage/src/templates/_post.elements.js

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,99 @@ export const PostContainer = styled.div`
128128
}
129129
130130
font-weight: 400;
131+
132+
.gatsby-highlight {
133+
background: #151515;
134+
border: 1px solid #242424;
135+
padding: 1rem;
136+
border-radius: 0.25rem;
137+
margin: 2rem 0 4rem 0;
138+
139+
pre {
140+
margin-bottom: 0;
141+
}
142+
143+
code {
144+
background-color: transparent;
145+
padding: 0;
146+
margin: 0;
147+
border: 0;
148+
font-size: 100%;
149+
height: auto !important;
150+
line-height: 20px;
151+
white-space: pre-wrap;
152+
word-break: break-word;
153+
}
154+
}
155+
156+
.token.comment {
157+
color: #5c6370;
158+
font-style: italic;
159+
}
160+
.token.keyword {
161+
color: #c678dd;
162+
}
163+
.token.selector {
164+
color: #c678dd;
165+
}
166+
.token.changed {
167+
color: #c678dd;
168+
}
169+
.token.operator {
170+
color: #abb2bf;
171+
}
172+
.token.property {
173+
color: #abb2bf;
174+
}
175+
.token.constant {
176+
color: #d19a66;
177+
}
178+
.token.number {
179+
color: #d19a66;
180+
}
181+
.token.builtin {
182+
color: #d19a66;
183+
}
184+
.token.attr-name {
185+
color: #d19a66;
186+
}
187+
.token.char {
188+
color: #56b6c2;
189+
}
190+
.token.symbol {
191+
color: #56b6c2;
192+
}
193+
.token.variable {
194+
color: #e06c75;
195+
}
196+
.token.tag {
197+
color: #e06c75;
198+
}
199+
.token.deleted {
200+
color: #e06c75;
201+
}
202+
.token.string {
203+
color: #98c379;
204+
}
205+
.token.inserted {
206+
color: #98c379;
207+
}
208+
.token.punctuation {
209+
color: #5c6370;
210+
}
211+
.token.function {
212+
color: #61afef;
213+
}
214+
.token.class-name {
215+
color: #e5c07b;
216+
}
217+
.token.important,
218+
.token.bold {
219+
font-weight: bold;
220+
}
221+
.token.italic {
222+
font-style: italic;
223+
}
131224
`};
132225
`;
133226

0 commit comments

Comments
 (0)