Skip to content

Commit 9222808

Browse files
committed
feat: add Velvet Circuit theme preset and enhance markdown preview styles
- Introduced a new theme preset "Velvet Circuit" with a unique color scheme. - Updated markdown preview styles for improved readability, including adjustments to font sizes and line heights for code blocks and headers.
1 parent 4567dcc commit 9222808

3 files changed

Lines changed: 22 additions & 8 deletions

File tree

components/markdown-preview.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,14 +283,14 @@ export function MarkdownPreview({
283283

284284
// Style the <pre> in-place (no reparenting)
285285
pre.className =
286-
'overflow-x-auto p-3 text-[11px] leading-[1.6] font-mono m-0 rounded-b-lg border border-[var(--border)] bg-[var(--bg)]'
286+
'overflow-x-auto p-3 text-[12.5px] leading-[1.7] font-mono m-0 rounded-b-lg border border-[var(--border)] bg-[var(--bg)]'
287287
pre.style.marginTop = '0'
288288

289289
// Insert a header *before* the <pre> as a sibling (not wrapping)
290290
const header = document.createElement('div')
291291
header.className =
292292
'code-block-header flex items-center justify-between h-7 px-3 bg-[var(--bg-secondary)] border border-b-0 border-[var(--border)] rounded-t-lg my-2 mb-0'
293-
header.innerHTML = `<span class="text-[9px] font-mono text-[var(--text-disabled)] uppercase tracking-wider">${lang || 'code'}</span><button class="copy-btn flex items-center gap-1 text-[9px] text-[var(--text-tertiary)] hover:text-[var(--text-secondary)] transition-colors cursor-pointer" title="Copy code">Copy</button>`
293+
header.innerHTML = `<span class="text-[10.5px] font-mono text-[var(--text-disabled)] uppercase tracking-[0.16em]">${lang || 'code'}</span><button class="copy-btn flex items-center gap-1 text-[10.5px] text-[var(--text-tertiary)] hover:text-[var(--text-secondary)] transition-colors cursor-pointer" title="Copy code">Copy</button>`
294294

295295
const copyHandler = () => {
296296
copyToClipboard(rawText).then((ok) => {

components/settings-panel.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -301,9 +301,11 @@ export function SettingsPanel({ onBack }: { onBack: () => void }) {
301301
<div className="mt-1 text-[11px] text-[var(--text-secondary)]">
302302
{preset.id === 'supreme'
303303
? 'Metallic accents and luxury shell chrome.'
304-
: preset.group === 'core'
305-
? 'Native palette tuned for the editor shell.'
306-
: 'Imported palette with custom texture and tone.'}
304+
: preset.id === 'velvet-circuit'
305+
? 'CyberNord’s femme-tech sister: noir glass, orchid neon, sapphire haze.'
306+
: preset.group === 'core'
307+
? 'Native palette tuned for the editor shell.'
308+
: 'Imported palette with custom texture and tone.'}
307309
</div>
308310
</button>
309311
)

context/theme-context.tsx

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,14 @@ import {
1212

1313
export type ThemeMode = 'light' | 'dark' | 'system'
1414
export type ResolvedMode = 'light' | 'dark'
15-
export type ThemeId = 'obsidian' | 'neon' | 'catppuccin-mocha' | 'bone' | 'supreme' | 'claude' | string
15+
export type ThemeId =
16+
| 'obsidian'
17+
| 'neon'
18+
| 'catppuccin-mocha'
19+
| 'bone'
20+
| 'supreme'
21+
| 'claude'
22+
| string
1623
export type EditorBgStyle = 'none' | 'grid' | 'dots' | 'gradient' | 'grid-logos'
1724

1825
export interface ThemePreset {
@@ -36,6 +43,7 @@ export const THEME_PRESETS: ThemePreset[] = [
3643
{ id: 'vintage-paper', label: 'Vintage Paper', color: '#8b5e3c', group: 'tweakcn' },
3744
{ id: 'voodoo', label: 'VooDoo', color: '#8b5cf6', group: 'core' },
3845
{ id: 'cybernord', label: 'CyberNord', color: '#00ff41', group: 'tweakcn' },
46+
{ id: 'velvet-circuit', label: 'Velvet Circuit', color: '#ff4fd8', group: 'core' },
3947
{ id: 'prettypink', label: 'PrettyPink', color: '#F5A9B8', group: 'core' },
4048
{ id: 'field-manual', label: 'Field Manual', color: '#4a6b2a', group: 'manual' },
4149
{ id: 'navy-ops', label: 'Navy Ops', color: '#4682b4', group: 'manual' },
@@ -254,13 +262,17 @@ export function ThemeProvider({ children }: { children: ReactNode }) {
254262

255263
const setEditorBgStyle = useCallback((s: EditorBgStyle) => {
256264
setEditorBgStyleState(s)
257-
try { localStorage.setItem('code-editor:editor-bg-style', s) } catch {}
265+
try {
266+
localStorage.setItem('code-editor:editor-bg-style', s)
267+
} catch {}
258268
}, [])
259269

260270
const setEditorBgOpacity = useCallback((v: number) => {
261271
const clamped = Math.min(100, Math.max(0, v))
262272
setEditorBgOpacityState(clamped)
263-
try { localStorage.setItem('code-editor:editor-bg-opacity', String(clamped)) } catch {}
273+
try {
274+
localStorage.setItem('code-editor:editor-bg-opacity', String(clamped))
275+
} catch {}
264276
}, [])
265277

266278
const value = useMemo<ThemeContextValue>(

0 commit comments

Comments
 (0)