-
-
Notifications
You must be signed in to change notification settings - Fork 134
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(solarized): add package exports field.
- Loading branch information
1 parent
8bfc8a5
commit affc260
Showing
7 changed files
with
277 additions
and
238 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
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 @@ | ||
declare module '@uiw/codemirror-theme-solarized/dark' { | ||
import { CreateThemeOptions } from '@uiw/codemirror-themes'; | ||
export const defaultSettingsSolarizedDark: CreateThemeOptions['settings']; | ||
export const solarizedDarkInit: (options?: Partial<CreateThemeOptions>) => import('@codemirror/state').Extension; | ||
export const solarizedDark: import('@codemirror/state').Extension; | ||
} |
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 @@ | ||
declare module '@uiw/codemirror-theme-solarized/light' { | ||
import { CreateThemeOptions } from '@uiw/codemirror-themes'; | ||
export const defaultSettingsSolarizedLight: CreateThemeOptions['settings']; | ||
export const solarizedLightInit: (options?: Partial<CreateThemeOptions>) => import('@codemirror/state').Extension; | ||
export const solarizedLight: import('@codemirror/state').Extension; | ||
} |
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,120 @@ | ||
import { tags as t } from '@lezer/highlight'; | ||
import { createTheme, CreateThemeOptions } from '@uiw/codemirror-themes'; | ||
|
||
export const defaultSettingsSolarizedDark: CreateThemeOptions['settings'] = { | ||
background: '#002b36', | ||
foreground: '#93a1a1', | ||
caret: '#839496', | ||
selection: '#173541', | ||
selectionMatch: '#aafe661a', | ||
gutterBackground: '#00252f', | ||
gutterForeground: '#839496', | ||
lineHighlight: '#173541', | ||
}; | ||
|
||
export const solarizedDarkInit = (options?: Partial<CreateThemeOptions>) => { | ||
const { theme = 'dark', settings = {}, styles = [] } = options || {}; | ||
return createTheme({ | ||
theme: theme, | ||
settings: { | ||
...defaultSettingsSolarizedDark, | ||
...settings, | ||
}, | ||
styles: [ | ||
{ tag: t.keyword, color: '#859900' }, | ||
{ | ||
tag: [t.name, t.deleted, t.character, t.propertyName, t.macroName], | ||
color: '#2aa198', | ||
}, | ||
{ tag: [t.variableName], color: '#93a1a1' }, | ||
{ tag: [t.function(t.variableName)], color: '#268bd2' }, | ||
{ tag: [t.labelName], color: '#d33682' }, | ||
{ | ||
tag: [t.color, t.constant(t.name), t.standard(t.name)], | ||
color: '#b58900', | ||
}, | ||
{ tag: [t.definition(t.name), t.separator], color: '#2aa198' }, | ||
{ tag: [t.brace], color: '#d33682' }, | ||
{ | ||
tag: [t.annotation], | ||
color: '#d30102', | ||
}, | ||
{ | ||
tag: [t.number, t.changed, t.annotation, t.modifier, t.self, t.namespace], | ||
color: '#d33682', | ||
}, | ||
{ | ||
tag: [t.typeName, t.className], | ||
color: '#cb4b16', | ||
}, | ||
{ | ||
tag: [t.operator, t.operatorKeyword], | ||
color: '#6c71c4', | ||
}, | ||
{ | ||
tag: [t.tagName], | ||
color: '#268bd2', | ||
}, | ||
{ | ||
tag: [t.squareBracket], | ||
color: '#dc322f', | ||
}, | ||
{ | ||
tag: [t.angleBracket], | ||
color: '#586e75', | ||
}, | ||
{ | ||
tag: [t.attributeName], | ||
color: '#93a1a1', | ||
}, | ||
{ | ||
tag: [t.regexp], | ||
color: '#d30102', | ||
}, | ||
{ | ||
tag: [t.quote], | ||
color: '#859900', | ||
}, | ||
{ tag: [t.string], color: '#b58900' }, | ||
{ | ||
tag: t.link, | ||
color: '#2aa198', | ||
textDecoration: 'underline', | ||
textUnderlinePosition: 'under', | ||
}, | ||
{ | ||
tag: [t.url, t.escape, t.special(t.string)], | ||
color: '#b58900', | ||
}, | ||
{ tag: [t.meta], color: '#dc322f' }, | ||
{ tag: [t.comment], color: '#586e75', fontStyle: 'italic' }, | ||
{ tag: t.strong, fontWeight: 'bold', color: '#eee8d5' }, | ||
{ tag: t.emphasis, fontStyle: 'italic', color: '#859900' }, | ||
{ tag: t.strikethrough, textDecoration: 'line-through' }, | ||
{ tag: t.heading, fontWeight: 'bold', color: '#b58900' }, | ||
{ tag: t.heading1, fontWeight: 'bold', color: '#fdf6e3' }, | ||
{ | ||
tag: [t.heading2, t.heading3, t.heading4], | ||
fontWeight: 'bold', | ||
color: '#eee8d5', | ||
}, | ||
{ | ||
tag: [t.heading5, t.heading6], | ||
color: '#eee8d5', | ||
}, | ||
{ tag: [t.atom, t.bool, t.special(t.variableName)], color: '#d33682' }, | ||
{ | ||
tag: [t.processingInstruction, t.inserted, t.contentSeparator], | ||
color: '#dc322f', | ||
}, | ||
{ | ||
tag: [t.contentSeparator], | ||
color: '#b58900', | ||
}, | ||
{ tag: t.invalid, color: '#586e75', borderBottom: `1px dotted #dc322f` }, | ||
...styles, | ||
], | ||
}); | ||
}; | ||
|
||
export const solarizedDark = solarizedDarkInit(); |
Oops, something went wrong.