-
-
Notifications
You must be signed in to change notification settings - Fork 142
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
VS Code Dark Theme? #409
Comments
Nice, thanks! However, it seems that the background color is not currently |
@karlhorky Upgrade |
Looking better already! A few more things (screenshots for reference below):
|
The font depends on what font is used in the outer layer. The fixed font will have a different style from the entire page, and it will be very inconvenient to modify. There is no fixed font, so setting the font is very flexible. |
Ok, trying to understand: So does that mean that there will be no support for setting Eg. if a theme developer decides that a specific font looks the best with the theme, there will be no built-in way to do that? It seems like allowing configuring |
import { tags as t } from '@lezer/highlight';
import { createTheme, CreateThemeOptions } from '@uiw/codemirror-themes';
initTheme({ settings: { fontFamily: 'Menlo, Monaco, Consolas, "Andale Mono", "Ubuntu Mono", "Courier New", monospace' }})
export function initTheme(options: CreateThemeOptions) {
const { theme = 'dark', settings = {}, styles = [] } = options || {}
return createTheme({
theme: theme,
settings: {
background: '#1e1e1e',
foreground: '#9cdcfe',
caret: '#c6c6c6',
selection: '#6199ff2f',
selectionMatch: '#72a1ff59',
lineHighlight: '#ffffff0f',
gutterBackground: '#1e1e1e',
gutterForeground: '#838383',
gutterActiveForeground: '#fff',
...settings
},
styles: [
{ tag: t.keyword, color: '#569cd6' },
...styles
],
});
}
export const vscodeDark = initTheme; @karlhorky This design api should be able to meet the needs of setting fonts, and also can reset fonts |
@karlhorky ultimate solution import { vscodeDark, vscodeDarkInit } from '@uiw/codemirror-theme-vscode';
<CodeMirror theme={vscodeDark} />
<CodeMirror
theme={vscodeDarkInit({
fontFamily: 'monospace',
})}
/> |
The default integrated font configuration can also be customized to be consistent with the entire website. |
Cool, that's nice! |
Screenshot of final theme after changes: PR open here: #414 |
@karlhorky Thank you very much 🙏, hard work. |
Thank you too! 🙌 Super fast iteration and pairing 👍 |
@jaywcjlove it seems like the Themes docs site is currently broken? (or maybe the theme itself somehow?) 1) Broken Link / Missing VS Code Dark themeThe link on the main page of the Themes docs home page is pointing at https://uiwjs.github.io/react-codemirror/#/theme/data/vscode/dark, which is currently 404 ![]() ![]() 2) Incorrect (or new?) VS Code light themeThe "VS Code" link in the sidebar of all Themes docs pages links to https://uiwjs.github.io/react-codemirror/#/theme/data/vscode, which is not a dark theme and is not the theme described in the issue above ![]() |
@karlhorky The bug has been resolved. Thx! |
@jaywcjlove Great, thanks! |
Would it be possible to get a theme similar to VS Code Dark?
It could be based on this one here: https://github.com/upleveled/theme-vs-code-dark-plus/blob/main/src/vs-code-dark-plus.ts
There are some for other editors as well:
The text was updated successfully, but these errors were encountered: