-
-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add xcode light/dark theme (#589)
* feat: add xcode light/dark theme * Create seven-shirts-hide.md
- Loading branch information
1 parent
13655b1
commit 953a081
Showing
10 changed files
with
239 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"@codeimage/app": patch | ||
"@codeimage/highlight": patch | ||
--- | ||
|
||
feat: add xcode light/dark theme |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import {createTheme} from '../../core'; | ||
import {palette, xCodeDark} from './xCodeDark'; | ||
|
||
export const xCodeDarkTheme = createTheme({ | ||
id: 'xCodeDark', | ||
editorTheme: xCodeDark, | ||
properties: { | ||
darkMode: true, | ||
label: 'XCode Dark', | ||
previewBackground: `linear-gradient(to top, #a18cd1 0%, #fbc2eb 100%)`, | ||
terminal: { | ||
main: palette.foreground, | ||
text: palette.text, | ||
}, | ||
}, | ||
} as const); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
import {HighlightStyle, syntaxHighlighting} from '@codemirror/language'; | ||
import {tags} from '@lezer/highlight'; | ||
import {defineEditorTheme} from '../../core'; | ||
|
||
const colors = { | ||
pink: '#FF79B2', | ||
violetLight: '#E5CFFF', | ||
violet: '#D9BBFF', | ||
purple: '#BB81FE', | ||
cyan: '#5FBCDC', | ||
orange: '#FE6465', | ||
gray3: '#727377', | ||
gray2: '#7F8C98', | ||
green: '#8AD1C2', | ||
green3: '#ACF2E4', | ||
blue: '#4FB0CB', | ||
yellow: '#FEE98B', | ||
}; | ||
|
||
export const palette = { | ||
foreground: '#1F1F24', | ||
text: '#CECFD0', | ||
text2: '#bebebe', | ||
punctuation: '#fff', | ||
numbers: colors.yellow, | ||
strings: colors.orange, | ||
property: colors.green, | ||
keywords: colors.pink, | ||
comments: colors.gray2, | ||
className: colors.cyan, | ||
function: colors.violet, | ||
}; | ||
|
||
export const xCodeDark = [ | ||
syntaxHighlighting( | ||
HighlightStyle.define([ | ||
{ | ||
tag: [tags.angleBracket], | ||
color: colors.purple, | ||
}, | ||
{ | ||
tag: [tags.definition(tags.variableName)], | ||
color: colors.blue, | ||
}, | ||
]), | ||
), | ||
defineEditorTheme({ | ||
highlight: { | ||
punctuation: palette.punctuation, | ||
delimiters: palette.punctuation, | ||
numbers: palette.numbers, | ||
strings: palette.strings, | ||
regexp: palette.strings, | ||
meta: colors.violet, | ||
variableName: palette.property, | ||
keywords: palette.keywords, | ||
base: palette.text, | ||
tag: colors.violet, | ||
comments: palette.comments, | ||
propertyName: palette.property, | ||
className: palette.className, | ||
function: palette.function, | ||
typeName: colors.violetLight, | ||
attrName: colors.purple, | ||
}, | ||
selection: { | ||
color: '#0000000f', | ||
backgroundColor: '#0000000f', | ||
activeLine: '#0000000f', | ||
}, | ||
lineNumbers: { | ||
color: palette.text2, | ||
}, | ||
cursor: { | ||
color: palette.text2, | ||
}, | ||
autocomplete: { | ||
background: '#202020', | ||
border: '#3c3c3c', | ||
selectedBackground: colors.purple, | ||
selectedColor: '#fff', | ||
}, | ||
darkMode: true, | ||
}), | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import {createTheme} from '../../core'; | ||
import {xCodeLight, palette} from './xCodeLight'; | ||
|
||
export const xCodeLightTheme = createTheme({ | ||
id: 'xCodeLight', | ||
editorTheme: xCodeLight, | ||
properties: { | ||
darkMode: false, | ||
label: 'XCode Light', | ||
previewBackground: `linear-gradient(to right bottom, #ffcc99, #f6bd83, #edad6e, #e49e59, #da8f44)`, | ||
terminal: { | ||
main: palette.foreground, | ||
text: palette.text, | ||
}, | ||
}, | ||
} as const); |
82 changes: 82 additions & 0 deletions
82
packages/highlight/src/lib/themes/xCodeLight/xCodeLight.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
import {HighlightStyle, syntaxHighlighting} from '@codemirror/language'; | ||
import {tags} from '@lezer/highlight'; | ||
import {defineEditorTheme} from '../../core'; | ||
|
||
const colors = { | ||
pink: '#c541ad', | ||
violetDark: '#573E93', | ||
violet: '#9157ea', | ||
purple: '#59458B', | ||
orange: '#D23423', | ||
gray3: '#727377', | ||
gray2: '#7F8C98', | ||
blue: '#326C81', | ||
darkBlue: '#322397', | ||
darkGreen: '#1E566A', | ||
}; | ||
|
||
export const palette = { | ||
foreground: '#FFF', | ||
text: '#191919', | ||
text2: '#CACACA', | ||
punctuation: '#1F1F24', | ||
numbers: colors.darkBlue, | ||
strings: colors.orange, | ||
property: colors.darkGreen, | ||
keywords: colors.pink, | ||
comments: colors.gray2, | ||
className: colors.darkGreen, | ||
function: colors.violet, | ||
}; | ||
|
||
export const xCodeLight = [ | ||
syntaxHighlighting( | ||
HighlightStyle.define([ | ||
{ | ||
tag: [tags.angleBracket], | ||
color: colors.purple, | ||
}, | ||
{ | ||
tag: [tags.definition(tags.variableName)], | ||
color: colors.blue, | ||
}, | ||
]), | ||
), | ||
defineEditorTheme({ | ||
highlight: { | ||
punctuation: palette.punctuation, | ||
delimiters: palette.punctuation, | ||
numbers: palette.numbers, | ||
strings: palette.strings, | ||
regexp: palette.strings, | ||
meta: colors.violet, | ||
variableName: palette.property, | ||
keywords: palette.keywords, | ||
base: palette.text, | ||
tag: colors.violet, | ||
comments: palette.comments, | ||
propertyName: palette.property, | ||
className: palette.className, | ||
function: palette.function, | ||
typeName: colors.darkGreen, | ||
attrName: colors.purple, | ||
}, | ||
selection: { | ||
color: colors.gray3, | ||
activeLine: '#ffffff0f', | ||
}, | ||
lineNumbers: { | ||
color: palette.text2, | ||
}, | ||
cursor: { | ||
color: palette.text2, | ||
}, | ||
autocomplete: { | ||
background: '#fff', | ||
border: '#c5c5c5', | ||
selectedBackground: colors.violetDark, | ||
selectedColor: '#fff', | ||
}, | ||
darkMode: true, | ||
}), | ||
]; |