Skip to content

Commit ed13456

Browse files
committed
Add oneDark/oneLight to theme exports
1 parent b3edc77 commit ed13456

File tree

3 files changed

+35
-39
lines changed

3 files changed

+35
-39
lines changed

packages/demo/src/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ type ThemeType = keyof typeof themes
1717
function App() {
1818
const [activeSampleCodeType, setActiveSampleCodeType] =
1919
useState<SampleCodeType>("TypeScript with React")
20-
const [activeThemeName, setActiveThemeName] = useState<ThemeType>("nightOwl")
20+
const [activeThemeName, setActiveThemeName] = useState<ThemeType>("oneDark")
2121

2222
const activeSampleCode = sampleCode[activeSampleCodeType]
2323
const activeTheme = themes[activeThemeName]

packages/prism-react-renderer/src/themes/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,5 @@ export { default as vsDark } from "./vsDark"
1414
export { default as vsLight } from "./vsLight"
1515
export { default as jettwaveDark } from "./jettwaveDark"
1616
export { default as jettwaveLight } from "./jettwaveLight"
17+
export { default as oneDark } from "./oneDark"
18+
export { default as oneLight } from "./oneLight"

packages/prism-react-renderer/src/themes/oneDark.ts

Lines changed: 32 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -13,72 +13,66 @@ const theme: PrismTheme = {
1313
},
1414
styles: [
1515
{
16-
types: [
17-
"comment",
18-
"prolog",
19-
"doctype",
20-
"cdata",
21-
"punctuation",
22-
],
16+
types: ["comment", "prolog", "cdata"],
2317
style: {
2418
color: "hsl(220, 10%, 40%)",
2519
},
2620
},
2721
{
28-
types: ["namespace"],
29-
style: {
30-
opacity: 0.7,
31-
},
32-
},
33-
{
34-
types: ["tag", "operator", "number"],
22+
types: ["doctype", "punctuation", "entity"],
3523
style: {
3624
color: "hsl(220, 14%, 71%)",
3725
},
3826
},
3927
{
40-
types: ["property", "function"],
41-
style: {
42-
color: "hsl(29, 54%, 61%)",
43-
},
28+
types: [
29+
"attr-name",
30+
"class-name",
31+
"maybe-class-name",
32+
"boolean",
33+
"constant",
34+
"number",
35+
"atrule",
36+
],
37+
style: { color: "hsl(29, 54%, 61%)" },
4438
},
4539
{
46-
types: ["tag-id", "selector", "atrule-id"],
47-
style: {
48-
color: "hsl(95, 38%, 62%)",
49-
},
40+
types: ["keyword"],
41+
style: { color: "hsl(286, 60%, 67%)" },
5042
},
5143
{
52-
types: ["attr-name"],
44+
types: ["property", "tag", "symbol", "deleted", "important"],
5345
style: {
54-
color: "hsl(187, 47%, 55%)",
46+
color: "hsl(355, 65%, 65%)",
5547
},
5648
},
49+
5750
{
5851
types: [
59-
"boolean",
52+
"selector",
6053
"string",
61-
"entity",
62-
"url",
63-
"attr-value",
64-
"keyword",
65-
"control",
66-
"directive",
67-
"unit",
68-
"statement",
54+
"char",
55+
"builtin",
56+
"inserted",
6957
"regex",
70-
"atrule",
58+
"attr-value",
7159
],
7260
style: {
73-
color: "hsl(220, 14%, 71%)",
61+
color: "hsl(95, 38%, 62%)",
7462
},
7563
},
7664
{
77-
types: ["placeholder", "variable"],
65+
types: ["variable", "operator", "function"],
7866
style: {
7967
color: "hsl(207, 82%, 66%)",
8068
},
8169
},
70+
{
71+
types: ["url"],
72+
style: {
73+
color: "hsl(187, 47%, 55%)",
74+
},
75+
},
8276
{
8377
types: ["deleted"],
8478
style: {
@@ -110,6 +104,6 @@ const theme: PrismTheme = {
110104
},
111105
},
112106
],
113-
};
107+
}
114108

115-
export default theme;
109+
export default theme

0 commit comments

Comments
 (0)