Skip to content

Commit 91093bd

Browse files
committed
Vendor code themes
1 parent 3ab3c79 commit 91093bd

File tree

4 files changed

+166
-5
lines changed

4 files changed

+166
-5
lines changed

code-themes/README.txt

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
These theme files are based on the themes in:
2+
3+
https://github.com/FormidableLabs/prism-react-renderer/tree/master/src/themes
4+
5+
under the license:
6+
7+
MIT License
8+
9+
Copyright (c) 2018 Formidable
10+
11+
Permission is hereby granted, free of charge, to any person obtaining a copy
12+
of this software and associated documentation files (the "Software"), to deal
13+
in the Software without restriction, including without limitation the rights
14+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15+
copies of the Software, and to permit persons to whom the Software is
16+
furnished to do so, subject to the following conditions:
17+
18+
The above copyright notice and this permission notice shall be included in all
19+
copies or substantial portions of the Software.
20+
21+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27+
SOFTWARE.

code-themes/dark.js

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
module.exports = {
2+
plain: {
3+
color: "#F8F8F2",
4+
backgroundColor: "#282A36",
5+
},
6+
styles: [
7+
{
8+
types: ["prolog", "constant", "builtin"],
9+
style: {
10+
color: "rgb(189, 147, 249)",
11+
},
12+
},
13+
{
14+
types: ["inserted", "function"],
15+
style: {
16+
color: "rgb(80, 250, 123)",
17+
},
18+
},
19+
{
20+
types: ["deleted"],
21+
style: {
22+
color: "rgb(255, 85, 85)",
23+
},
24+
},
25+
{
26+
types: ["changed"],
27+
style: {
28+
color: "rgb(255, 184, 108)",
29+
},
30+
},
31+
{
32+
types: ["punctuation", "symbol"],
33+
style: {
34+
color: "rgb(248, 248, 242)",
35+
},
36+
},
37+
{
38+
types: ["string", "char", "tag", "selector"],
39+
style: {
40+
color: "rgb(255, 121, 198)",
41+
},
42+
},
43+
{
44+
types: ["keyword", "variable"],
45+
style: {
46+
color: "rgb(189, 147, 249)",
47+
fontStyle: "italic",
48+
},
49+
},
50+
{
51+
types: ["comment"],
52+
style: {
53+
color: "rgb(98, 114, 164)",
54+
},
55+
},
56+
{
57+
types: ["attr-name"],
58+
style: {
59+
color: "rgb(241, 250, 140)",
60+
},
61+
},
62+
],
63+
};

code-themes/light.js

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
module.exports = {
2+
plain: {
3+
color: "#393A34",
4+
backgroundColor: "#f6f8fa",
5+
},
6+
styles: [
7+
{
8+
types: ["comment", "prolog", "doctype", "cdata"],
9+
style: {
10+
color: "#999988",
11+
fontStyle: "italic",
12+
},
13+
},
14+
{
15+
types: ["namespace"],
16+
style: {
17+
opacity: 0.7,
18+
},
19+
},
20+
{
21+
types: ["string", "attr-value"],
22+
style: {
23+
color: "#e3116c",
24+
},
25+
},
26+
{
27+
types: ["punctuation", "operator"],
28+
style: {
29+
color: "#393A34",
30+
},
31+
},
32+
{
33+
types: [
34+
"entity",
35+
"url",
36+
"symbol",
37+
"number",
38+
"boolean",
39+
"variable",
40+
"constant",
41+
"property",
42+
"regex",
43+
"inserted",
44+
],
45+
style: {
46+
color: "#36acaa",
47+
},
48+
},
49+
{
50+
types: ["atrule", "keyword", "attr-name", "selector"],
51+
style: {
52+
color: "#00a4db",
53+
},
54+
},
55+
{
56+
types: ["function", "deleted", "tag"],
57+
style: {
58+
color: "#d73a49",
59+
},
60+
},
61+
{
62+
types: ["function-variable"],
63+
style: {
64+
color: "#6f42c1",
65+
},
66+
},
67+
{
68+
types: ["tag", "selector", "keyword"],
69+
style: {
70+
color: "#00009f",
71+
},
72+
},
73+
],
74+
};

docusaurus.config.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
const lightCodeTheme = require('prism-react-renderer/themes/github');
2-
const darkCodeTheme = require('prism-react-renderer/themes/dracula');
3-
41
/** @type {import('@docusaurus/types').DocusaurusConfig} */
52
module.exports = {
63
title: 'TurboWarp Documentation',
@@ -47,8 +44,8 @@ module.exports = {
4744
respectPrefersColorScheme: true,
4845
},
4946
prism: {
50-
theme: lightCodeTheme,
51-
darkTheme: darkCodeTheme,
47+
theme: require('./code-themes/light'),
48+
darkTheme: require('./code-themes/dark'),
5249
},
5350
},
5451
presets: [

0 commit comments

Comments
 (0)