Skip to content

Commit

Permalink
add custom GH theme
Browse files Browse the repository at this point in the history
  • Loading branch information
manuelpuyol committed Feb 22, 2021
1 parent 078e0ae commit 5709e7a
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 2 deletions.
2 changes: 1 addition & 1 deletion theme/src/components/code.js
@@ -1,7 +1,7 @@
import { Absolute, Box, Relative, Text } from '@primer/components'
import Highlight, { defaultProps } from 'prism-react-renderer'
import Prism from '../prism'
import githubTheme from 'prism-react-renderer/themes/github'
import githubTheme from '../github'
import React from 'react'
import ClipboardCopy from './clipboard-copy'
import LiveCode from './live-code'
Expand Down
2 changes: 1 addition & 1 deletion theme/src/components/live-code.js
@@ -1,6 +1,6 @@
import {Absolute, BorderBox, Flex, Relative, Text} from '@primer/components'
import htmlReactParser from 'html-react-parser'
import githubTheme from 'prism-react-renderer/themes/github'
import githubTheme from '../github'
import React, {useState} from 'react'
import reactElementToJsxString from 'react-element-to-jsx-string'
import {LiveEditor, LiveError, LivePreview, LiveProvider} from 'react-live'
Expand Down
74 changes: 74 additions & 0 deletions theme/src/github.js
@@ -0,0 +1,74 @@
export default {
plain: {
color: "#393A34",
backgroundColor: "#f6f8fa",
},
styles: [
{
types: ["comment", "prolog", "doctype", "cdata"],
style: {
color: "#999988",
fontStyle: "italic",
},
},
{
types: ["namespace"],
style: {
opacity: 0.7,
},
},
{
types: ["string", "attr-value"],
style: {
color: "#e3116c",
},
},
{
types: ["punctuation", "operator"],
style: {
color: "#393A34",
},
},
{
types: [
"entity",
"url",
"symbol",
"number",
"boolean",
"variable",
"constant",
"property",
"regex",
"inserted",
],
style: {
color: "#36acaa",
},
},
{
types: ["atrule", "keyword", "attr-name", "selector"],
style: {
color: "#00a4db",
},
},
{
types: ["function", "deleted", "tag"],
style: {
color: "#d73a49",
},
},
{
types: ["function-variable"],
style: {
color: "#6f42c1",
},
},
{
types: ["tag", "selector", "keyword"],
style: {
color: "#00009f",
},
},
],
};

0 comments on commit 5709e7a

Please sign in to comment.