Skip to content

Commit

Permalink
feat(theme): add gruvbox light theme.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Dec 4, 2022
1 parent 2717cdd commit 2df3352
Show file tree
Hide file tree
Showing 4 changed files with 121 additions and 2 deletions.
6 changes: 5 additions & 1 deletion themes/gruvbox/README.md
Expand Up @@ -10,6 +10,10 @@
<img width="436" alt="codemirror-theme-eclipse" src="https://user-images.githubusercontent.com/1680273/201111051-c38a73ca-a449-4c01-a4ff-4a675886ca9d.png">
</a>

<a href="https://uiwjs.github.io/react-codemirror/#/theme/data/gruvbox/light">
<img width="436" alt="codemirror-theme-eclipse" src="https://user-images.githubusercontent.com/1680273/205499803-e1e2e214-dc3e-488a-9037-ba979e5ce199.png">
</a>

## Install

```bash
Expand All @@ -20,7 +24,7 @@ npm install @uiw/codemirror-theme-gruvbox-dark --save

```jsx
import CodeMirror from '@uiw/react-codemirror';
import { gruvboxDark } from '@uiw/codemirror-theme-gruvbox-dark';
import { gruvboxDark, gruvboxLight } from '@uiw/codemirror-theme-gruvbox-dark';
import { javascript } from '@codemirror/lang-javascript';

function App() {
Expand Down
109 changes: 109 additions & 0 deletions themes/gruvbox/src/index.ts
Expand Up @@ -36,3 +36,112 @@ export const gruvboxDark = createTheme({
{ tag: t.attributeName, color: '#8ec07c' },
],
});

export const gruvboxLight = createTheme({
theme: 'light',
settings: {
background: '#fbf1c7',
foreground: '#3c3836',
caret: '#af3a03',
selection: '#ebdbb2',
selectionMatch: '#bdae93',
lineHighlight: '#ebdbb2',
gutterBackground: '#ebdbb2',
gutterForeground: '#665c54',
gutterBorder: 'transparent',
},
styles: [
{ tag: t.keyword, color: '#9d0006' },
{
tag: [t.name, t.deleted, t.character, t.propertyName, t.macroName],
color: '#427b58',
},
{ tag: [t.variableName], color: '#076678' },
{ tag: [t.function(t.variableName)], color: '#79740e', fontStyle: 'bold' },
{ tag: [t.labelName], color: '#3c3836' },
{
tag: [t.color, t.constant(t.name), t.standard(t.name)],
color: '#8f3f71',
},
{ tag: [t.definition(t.name), t.separator], color: '#3c3836' },
{ tag: [t.brace], color: '#3c3836' },
{
tag: [t.annotation],
color: '#9d0006',
},
{
tag: [t.number, t.changed, t.annotation, t.modifier, t.self, t.namespace],
color: '#8f3f71',
},
{
tag: [t.typeName, t.className],
color: '#b57614',
},
{
tag: [t.operator, t.operatorKeyword],
color: '#9d0006',
},
{
tag: [t.tagName],
color: '#427b58',
fontStyle: 'bold',
},
{
tag: [t.squareBracket],
color: '#af3a03',
},
{
tag: [t.angleBracket],
color: '#076678',
},
{
tag: [t.attributeName],
color: '#427b58',
},
{
tag: [t.regexp],
color: '#427b58',
},
{
tag: [t.quote],
color: '#928374',
},
{ tag: [t.string], color: '#3c3836' },
{
tag: t.link,
color: '#7c6f64',
textDecoration: 'underline',
textUnderlinePosition: 'under',
},
{
tag: [t.url, t.escape, t.special(t.string)],
color: '#8f3f71',
},
{ tag: [t.meta], color: '#b57614' },
{ tag: [t.comment], color: '#928374', fontStyle: 'italic' },
{ tag: t.strong, fontWeight: 'bold', color: '#af3a03' },
{ tag: t.emphasis, fontStyle: 'italic', color: '#79740e' },
{ tag: t.strikethrough, textDecoration: 'line-through' },
{ tag: t.heading, fontWeight: 'bold', color: '#79740e' },
{ tag: [t.heading1, t.heading2], fontWeight: 'bold', color: '#79740e' },
{
tag: [t.heading3, t.heading4],
fontWeight: 'bold',
color: '#b57614',
},
{
tag: [t.heading5, t.heading6],
color: '#b57614',
},
{ tag: [t.atom, t.bool, t.special(t.variableName)], color: '#8f3f71' },
{
tag: [t.processingInstruction, t.inserted],
color: '#076678',
},
{
tag: [t.contentSeparator],
color: '#9d0006',
},
{ tag: t.invalid, color: '#af3a03', borderBottom: `1px dotted #9d0006` },
],
});
4 changes: 4 additions & 0 deletions themes/theme/README.md
Expand Up @@ -188,6 +188,10 @@ export default App;
<img width="436" alt="codemirror-theme-gruvbox-dark" src="https://user-images.githubusercontent.com/1680273/201111051-c38a73ca-a449-4c01-a4ff-4a675886ca9d.png">
</a>

<a href="https://uiwjs.github.io/react-codemirror/#/theme/data/gruvbox/light">
<img width="436" alt="codemirror-theme-eclipse" src="https://user-images.githubusercontent.com/1680273/205499803-e1e2e214-dc3e-488a-9037-ba979e5ce199.png">
</a>

**nord**

<a href="https://uiwjs.github.io/react-codemirror/#/theme/data/nord">
Expand Down
4 changes: 3 additions & 1 deletion www/src/pages/theme/themes/Datas.ts
Expand Up @@ -27,7 +27,7 @@ import { bespin } from '@uiw/codemirror-theme-bespin';
import { vscodeDark } from '@uiw/codemirror-theme-vscode';
import { duotoneLight, duotoneDark } from '@uiw/codemirror-theme-duotone';
import { githubLight, githubDark } from '@uiw/codemirror-theme-github';
import { gruvboxDark } from '@uiw/codemirror-theme-gruvbox-dark';
import { gruvboxDark, gruvboxLight } from '@uiw/codemirror-theme-gruvbox-dark';
import { nord } from '@uiw/codemirror-theme-nord';
import { sublime } from '@uiw/codemirror-theme-sublime';
import { xcodeLight, xcodeDark } from '@uiw/codemirror-theme-xcode';
Expand All @@ -46,6 +46,7 @@ export const mdSource = {
githubLight: githubMd.source,
githubDark: githubMd.source,
gruvboxDark: gruvboxDarkMd.source,
gruvboxLight: gruvboxDarkMd.source,
nord: nordMd.source,
okaidia: okaidiaMd.source,
sublime: sublimeMd.source,
Expand All @@ -68,6 +69,7 @@ export const themeData = {
githubLight,
githubDark,
gruvboxDark,
gruvboxLight,
nord,
okaidia,
sublime,
Expand Down

0 comments on commit 2df3352

Please sign in to comment.