1package styles
2
3import (
4 "image/color"
5
6 "charm.land/bubbles/v2/filepicker"
7 "charm.land/bubbles/v2/help"
8 "charm.land/bubbles/v2/textarea"
9 "charm.land/bubbles/v2/textinput"
10 tea "charm.land/bubbletea/v2"
11 "charm.land/glamour/v2/ansi"
12 "charm.land/lipgloss/v2"
13 "github.com/alecthomas/chroma/v2"
14 "github.com/charmbracelet/crush/internal/tui/exp/diffview"
15 "github.com/charmbracelet/x/exp/charmtone"
16)
17
18const (
19 CheckIcon string = "β"
20 ErrorIcon string = "Γ"
21 WarningIcon string = "β "
22 InfoIcon string = "β"
23 HintIcon string = "β΅"
24 SpinnerIcon string = "β―"
25 LoadingIcon string = "β³"
26 ModelIcon string = "β"
27
28 ArrowRightIcon string = "β"
29
30 ToolPending string = "β"
31 ToolSuccess string = "β"
32 ToolError string = "Γ"
33
34 RadioOn string = "β"
35 RadioOff string = "β"
36
37 BorderThin string = "β"
38 BorderThick string = "β"
39
40 SectionSeparator string = "β"
41
42 TodoCompletedIcon string = "β"
43 TodoPendingIcon string = "β’"
44 TodoInProgressIcon string = "β"
45
46 ImageIcon string = "β "
47 TextIcon string = "β‘"
48
49 ScrollbarThumb string = "β"
50 ScrollbarTrack string = "β"
51)
52
53const (
54 defaultMargin = 2
55 defaultListIndent = 2
56)
57
58type Styles struct {
59 WindowTooSmall lipgloss.Style
60
61 // Reusable text styles
62 Base lipgloss.Style
63 Muted lipgloss.Style
64 HalfMuted lipgloss.Style
65 Subtle lipgloss.Style
66
67 // Tags
68 TagBase lipgloss.Style
69 TagError lipgloss.Style
70 TagInfo lipgloss.Style
71
72 // Header
73 Header struct {
74 Charm lipgloss.Style // Style for "Charmβ’" label
75 Diagonals lipgloss.Style // Style for diagonal separators (β±)
76 Percentage lipgloss.Style // Style for context percentage
77 Keystroke lipgloss.Style // Style for keystroke hints (e.g., "ctrl+d")
78 KeystrokeTip lipgloss.Style // Style for keystroke action text (e.g., "open", "close")
79 WorkingDir lipgloss.Style // Style for current working directory
80 Separator lipgloss.Style // Style for separator dots (β’)
81 }
82
83 CompactDetails struct {
84 View lipgloss.Style
85 Version lipgloss.Style
86 Title lipgloss.Style
87 }
88
89 // Panels
90 PanelMuted lipgloss.Style
91 PanelBase lipgloss.Style
92
93 // Line numbers for code blocks
94 LineNumber lipgloss.Style
95
96 // Message borders
97 FocusedMessageBorder lipgloss.Border
98
99 // Tool calls
100 ToolCallPending lipgloss.Style
101 ToolCallError lipgloss.Style
102 ToolCallSuccess lipgloss.Style
103 ToolCallCancelled lipgloss.Style
104 EarlyStateMessage lipgloss.Style
105
106 // Text selection
107 TextSelection lipgloss.Style
108
109 // LSP and MCP status indicators
110 ItemOfflineIcon lipgloss.Style
111 ItemBusyIcon lipgloss.Style
112 ItemErrorIcon lipgloss.Style
113 ItemOnlineIcon lipgloss.Style
114
115 // Markdown & Chroma
116 Markdown ansi.StyleConfig
117 PlainMarkdown ansi.StyleConfig
118
119 // Inputs
120 TextInput textinput.Styles
121 TextArea textarea.Styles
122
123 // Help
124 Help help.Styles
125
126 // Diff
127 Diff diffview.Style
128
129 // FilePicker
130 FilePicker filepicker.Styles
131
132 // Buttons
133 ButtonFocus lipgloss.Style
134 ButtonBlur lipgloss.Style
135
136 // Borders
137 BorderFocus lipgloss.Style
138 BorderBlur lipgloss.Style
139
140 // Editor
141 EditorPromptNormalFocused lipgloss.Style
142 EditorPromptNormalBlurred lipgloss.Style
143 EditorPromptYoloIconFocused lipgloss.Style
144 EditorPromptYoloIconBlurred lipgloss.Style
145 EditorPromptYoloDotsFocused lipgloss.Style
146 EditorPromptYoloDotsBlurred lipgloss.Style
147
148 // Radio
149 RadioOn lipgloss.Style
150 RadioOff lipgloss.Style
151
152 // Background
153 Background color.Color
154
155 // Logo
156 LogoFieldColor color.Color
157 LogoTitleColorA color.Color
158 LogoTitleColorB color.Color
159 LogoCharmColor color.Color
160 LogoVersionColor color.Color
161
162 // Colors - semantic colors for tool rendering.
163 Primary color.Color
164 Secondary color.Color
165 Tertiary color.Color
166 BgBase color.Color
167 BgBaseLighter color.Color
168 BgSubtle color.Color
169 BgOverlay color.Color
170 FgBase color.Color
171 FgMuted color.Color
172 FgHalfMuted color.Color
173 FgSubtle color.Color
174 Border color.Color
175 BorderColor color.Color // Border focus color
176 Error color.Color
177 Warning color.Color
178 Info color.Color
179 White color.Color
180 BlueLight color.Color
181 Blue color.Color
182 BlueDark color.Color
183 GreenLight color.Color
184 Green color.Color
185 GreenDark color.Color
186 Red color.Color
187 RedDark color.Color
188 Yellow color.Color
189
190 // Section Title
191 Section struct {
192 Title lipgloss.Style
193 Line lipgloss.Style
194 }
195
196 // Initialize
197 Initialize struct {
198 Header lipgloss.Style
199 Content lipgloss.Style
200 Accent lipgloss.Style
201 }
202
203 // LSP
204 LSP struct {
205 ErrorDiagnostic lipgloss.Style
206 WarningDiagnostic lipgloss.Style
207 HintDiagnostic lipgloss.Style
208 InfoDiagnostic lipgloss.Style
209 }
210
211 // Files
212 Files struct {
213 Path lipgloss.Style
214 Additions lipgloss.Style
215 Deletions lipgloss.Style
216 }
217
218 // Chat
219 Chat struct {
220 // Message item styles
221 Message struct {
222 UserBlurred lipgloss.Style
223 UserFocused lipgloss.Style
224 AssistantBlurred lipgloss.Style
225 AssistantFocused lipgloss.Style
226 NoContent lipgloss.Style
227 Thinking lipgloss.Style
228 ErrorTag lipgloss.Style
229 ErrorTitle lipgloss.Style
230 ErrorDetails lipgloss.Style
231 ToolCallFocused lipgloss.Style
232 ToolCallCompact lipgloss.Style
233 ToolCallBlurred lipgloss.Style
234 SectionHeader lipgloss.Style
235
236 // Thinking section styles
237 ThinkingBox lipgloss.Style // Background for thinking content
238 ThinkingTruncationHint lipgloss.Style // "β¦ (N lines hidden)" hint
239 ThinkingFooterTitle lipgloss.Style // "Thought for" text
240 ThinkingFooterDuration lipgloss.Style // Duration value
241 AssistantInfoIcon lipgloss.Style
242 AssistantInfoModel lipgloss.Style
243 AssistantInfoProvider lipgloss.Style
244 AssistantInfoDuration lipgloss.Style
245 }
246 }
247
248 // Tool - styles for tool call rendering
249 Tool struct {
250 // Icon styles with tool status
251 IconPending lipgloss.Style // Pending operation icon
252 IconSuccess lipgloss.Style // Successful operation icon
253 IconError lipgloss.Style // Error operation icon
254 IconCancelled lipgloss.Style // Cancelled operation icon
255
256 // Tool name styles
257 NameNormal lipgloss.Style // Normal tool name
258 NameNested lipgloss.Style // Nested tool name
259
260 // Parameter list styles
261 ParamMain lipgloss.Style // Main parameter
262 ParamKey lipgloss.Style // Parameter keys
263
264 // Content rendering styles
265 ContentLine lipgloss.Style // Individual content line with background and width
266 ContentTruncation lipgloss.Style // Truncation message "β¦ (N lines)"
267 ContentCodeLine lipgloss.Style // Code line with background and width
268 ContentCodeTruncation lipgloss.Style // Code truncation message with bgBase
269 ContentCodeBg color.Color // Background color for syntax highlighting
270 Body lipgloss.Style // Body content padding (PaddingLeft(2))
271
272 // Deprecated - kept for backward compatibility
273 ContentBg lipgloss.Style // Content background
274 ContentText lipgloss.Style // Content text
275 ContentLineNumber lipgloss.Style // Line numbers in code
276
277 // State message styles
278 StateWaiting lipgloss.Style // "Waiting for tool response..."
279 StateCancelled lipgloss.Style // "Canceled."
280
281 // Error styles
282 ErrorTag lipgloss.Style // ERROR tag
283 ErrorMessage lipgloss.Style // Error message text
284
285 // Diff styles
286 DiffTruncation lipgloss.Style // Diff truncation message with padding
287
288 // Multi-edit note styles
289 NoteTag lipgloss.Style // NOTE tag (yellow background)
290 NoteMessage lipgloss.Style // Note message text
291
292 // Job header styles (for bash jobs)
293 JobIconPending lipgloss.Style // Pending job icon (green dark)
294 JobIconError lipgloss.Style // Error job icon (red dark)
295 JobIconSuccess lipgloss.Style // Success job icon (green)
296 JobToolName lipgloss.Style // Job tool name "Bash" (blue)
297 JobAction lipgloss.Style // Action text (Start, Output, Kill)
298 JobPID lipgloss.Style // PID text
299 JobDescription lipgloss.Style // Description text
300
301 // Agent task styles
302 AgentTaskTag lipgloss.Style // Agent task tag (blue background, bold)
303 AgentPrompt lipgloss.Style // Agent prompt text
304
305 // Agentic fetch styles
306 AgenticFetchPromptTag lipgloss.Style // Agentic fetch prompt tag (green background, bold)
307
308 // Todo styles
309 TodoRatio lipgloss.Style // Todo ratio (e.g., "2/5")
310 TodoCompletedIcon lipgloss.Style // Completed todo icon
311 TodoInProgressIcon lipgloss.Style // In-progress todo icon
312 TodoPendingIcon lipgloss.Style // Pending todo icon
313
314 // MCP tools
315 MCPName lipgloss.Style // The mcp name
316 MCPToolName lipgloss.Style // The mcp tool name
317 MCPArrow lipgloss.Style // The mcp arrow icon
318 }
319
320 // Dialog styles
321 Dialog struct {
322 Title lipgloss.Style
323 TitleText lipgloss.Style
324 TitleError lipgloss.Style
325 TitleAccent lipgloss.Style
326 // View is the main content area style.
327 View lipgloss.Style
328 PrimaryText lipgloss.Style
329 SecondaryText lipgloss.Style
330 // HelpView is the line that contains the help.
331 HelpView lipgloss.Style
332 Help struct {
333 Ellipsis lipgloss.Style
334 ShortKey lipgloss.Style
335 ShortDesc lipgloss.Style
336 ShortSeparator lipgloss.Style
337 FullKey lipgloss.Style
338 FullDesc lipgloss.Style
339 FullSeparator lipgloss.Style
340 }
341
342 NormalItem lipgloss.Style
343 SelectedItem lipgloss.Style
344 InputPrompt lipgloss.Style
345
346 List lipgloss.Style
347
348 Spinner lipgloss.Style
349
350 // ContentPanel is used for content blocks with subtle background.
351 ContentPanel lipgloss.Style
352
353 // Scrollbar styles for scrollable content.
354 ScrollbarThumb lipgloss.Style
355 ScrollbarTrack lipgloss.Style
356
357 // Arguments
358 Arguments struct {
359 Content lipgloss.Style
360 Description lipgloss.Style
361 InputLabelBlurred lipgloss.Style
362 InputLabelFocused lipgloss.Style
363 InputRequiredMarkBlurred lipgloss.Style
364 InputRequiredMarkFocused lipgloss.Style
365 }
366
367 Commands struct{}
368
369 ImagePreview lipgloss.Style
370
371 Sessions struct {
372 DeletingView lipgloss.Style
373 DeletingItemFocused lipgloss.Style
374 DeletingItemBlurred lipgloss.Style
375 DeletingTitle lipgloss.Style
376 DeletingMessage lipgloss.Style
377 DeletingTitleGradientFromColor color.Color
378 DeletingTitleGradientToColor color.Color
379 }
380 }
381
382 // Status bar and help
383 Status struct {
384 Help lipgloss.Style
385
386 ErrorIndicator lipgloss.Style
387 WarnIndicator lipgloss.Style
388 InfoIndicator lipgloss.Style
389 UpdateIndicator lipgloss.Style
390 SuccessIndicator lipgloss.Style
391
392 ErrorMessage lipgloss.Style
393 WarnMessage lipgloss.Style
394 InfoMessage lipgloss.Style
395 UpdateMessage lipgloss.Style
396 SuccessMessage lipgloss.Style
397 }
398
399 // Completions popup styles
400 Completions struct {
401 Normal lipgloss.Style
402 Focused lipgloss.Style
403 Match lipgloss.Style
404 }
405
406 // Attachments styles
407 Attachments struct {
408 Normal lipgloss.Style
409 Image lipgloss.Style
410 Text lipgloss.Style
411 Deleting lipgloss.Style
412 }
413
414 // Pills styles for todo/queue pills
415 Pills struct {
416 Base lipgloss.Style // Base pill style with padding
417 Focused lipgloss.Style // Focused pill with visible border
418 Blurred lipgloss.Style // Blurred pill with hidden border
419 QueueItemPrefix lipgloss.Style // Prefix for queue list items
420 HelpKey lipgloss.Style // Keystroke hint style
421 HelpText lipgloss.Style // Help action text style
422 Area lipgloss.Style // Pills area container
423 TodoSpinner lipgloss.Style // Todo spinner style
424 }
425}
426
427// ChromaTheme converts the current markdown chroma styles to a chroma
428// StyleEntries map.
429func (s *Styles) ChromaTheme() chroma.StyleEntries {
430 rules := s.Markdown.CodeBlock
431
432 return chroma.StyleEntries{
433 chroma.Text: chromaStyle(rules.Chroma.Text),
434 chroma.Error: chromaStyle(rules.Chroma.Error),
435 chroma.Comment: chromaStyle(rules.Chroma.Comment),
436 chroma.CommentPreproc: chromaStyle(rules.Chroma.CommentPreproc),
437 chroma.Keyword: chromaStyle(rules.Chroma.Keyword),
438 chroma.KeywordReserved: chromaStyle(rules.Chroma.KeywordReserved),
439 chroma.KeywordNamespace: chromaStyle(rules.Chroma.KeywordNamespace),
440 chroma.KeywordType: chromaStyle(rules.Chroma.KeywordType),
441 chroma.Operator: chromaStyle(rules.Chroma.Operator),
442 chroma.Punctuation: chromaStyle(rules.Chroma.Punctuation),
443 chroma.Name: chromaStyle(rules.Chroma.Name),
444 chroma.NameBuiltin: chromaStyle(rules.Chroma.NameBuiltin),
445 chroma.NameTag: chromaStyle(rules.Chroma.NameTag),
446 chroma.NameAttribute: chromaStyle(rules.Chroma.NameAttribute),
447 chroma.NameClass: chromaStyle(rules.Chroma.NameClass),
448 chroma.NameConstant: chromaStyle(rules.Chroma.NameConstant),
449 chroma.NameDecorator: chromaStyle(rules.Chroma.NameDecorator),
450 chroma.NameException: chromaStyle(rules.Chroma.NameException),
451 chroma.NameFunction: chromaStyle(rules.Chroma.NameFunction),
452 chroma.NameOther: chromaStyle(rules.Chroma.NameOther),
453 chroma.Literal: chromaStyle(rules.Chroma.Literal),
454 chroma.LiteralNumber: chromaStyle(rules.Chroma.LiteralNumber),
455 chroma.LiteralDate: chromaStyle(rules.Chroma.LiteralDate),
456 chroma.LiteralString: chromaStyle(rules.Chroma.LiteralString),
457 chroma.LiteralStringEscape: chromaStyle(rules.Chroma.LiteralStringEscape),
458 chroma.GenericDeleted: chromaStyle(rules.Chroma.GenericDeleted),
459 chroma.GenericEmph: chromaStyle(rules.Chroma.GenericEmph),
460 chroma.GenericInserted: chromaStyle(rules.Chroma.GenericInserted),
461 chroma.GenericStrong: chromaStyle(rules.Chroma.GenericStrong),
462 chroma.GenericSubheading: chromaStyle(rules.Chroma.GenericSubheading),
463 chroma.Background: chromaStyle(rules.Chroma.Background),
464 }
465}
466
467// DialogHelpStyles returns the styles for dialog help.
468func (s *Styles) DialogHelpStyles() help.Styles {
469 return help.Styles(s.Dialog.Help)
470}
471
472// DefaultStyles returns the default styles for the UI.
473func DefaultStyles() Styles {
474 var (
475 primary = charmtone.Charple
476 secondary = charmtone.Dolly
477 tertiary = charmtone.Bok
478 // accent = charmtone.Zest
479
480 // Backgrounds
481 bgBase = charmtone.Pepper
482 bgBaseLighter = charmtone.BBQ
483 bgSubtle = charmtone.Charcoal
484 bgOverlay = charmtone.Iron
485
486 // Foregrounds
487 fgBase = charmtone.Ash
488 fgMuted = charmtone.Squid
489 fgHalfMuted = charmtone.Smoke
490 fgSubtle = charmtone.Oyster
491 // fgSelected = charmtone.Salt
492
493 // Borders
494 border = charmtone.Charcoal
495 borderFocus = charmtone.Charple
496
497 // Status
498 error = charmtone.Sriracha
499 warning = charmtone.Zest
500 info = charmtone.Malibu
501
502 // Colors
503 white = charmtone.Butter
504
505 blueLight = charmtone.Sardine
506 blue = charmtone.Malibu
507 blueDark = charmtone.Damson
508
509 // yellow = charmtone.Mustard
510 yellow = charmtone.Mustard
511 // citron = charmtone.Citron
512
513 greenLight = charmtone.Bok
514 green = charmtone.Julep
515 greenDark = charmtone.Guac
516 // greenLight = charmtone.Bok
517
518 red = charmtone.Coral
519 redDark = charmtone.Sriracha
520 // redLight = charmtone.Salmon
521 // cherry = charmtone.Cherry
522 )
523
524 normalBorder := lipgloss.NormalBorder()
525
526 base := lipgloss.NewStyle().Foreground(fgBase)
527
528 s := Styles{}
529
530 s.Background = bgBase
531
532 // Populate color fields
533 s.Primary = primary
534 s.Secondary = secondary
535 s.Tertiary = tertiary
536 s.BgBase = bgBase
537 s.BgBaseLighter = bgBaseLighter
538 s.BgSubtle = bgSubtle
539 s.BgOverlay = bgOverlay
540 s.FgBase = fgBase
541 s.FgMuted = fgMuted
542 s.FgHalfMuted = fgHalfMuted
543 s.FgSubtle = fgSubtle
544 s.Border = border
545 s.BorderColor = borderFocus
546 s.Error = error
547 s.Warning = warning
548 s.Info = info
549 s.White = white
550 s.BlueLight = blueLight
551 s.Blue = blue
552 s.BlueDark = blueDark
553 s.GreenLight = greenLight
554 s.Green = green
555 s.GreenDark = greenDark
556 s.Red = red
557 s.RedDark = redDark
558 s.Yellow = yellow
559
560 s.TextInput = textinput.Styles{
561 Focused: textinput.StyleState{
562 Text: base,
563 Placeholder: base.Foreground(fgSubtle),
564 Prompt: base.Foreground(tertiary),
565 Suggestion: base.Foreground(fgSubtle),
566 },
567 Blurred: textinput.StyleState{
568 Text: base.Foreground(fgMuted),
569 Placeholder: base.Foreground(fgSubtle),
570 Prompt: base.Foreground(fgMuted),
571 Suggestion: base.Foreground(fgSubtle),
572 },
573 Cursor: textinput.CursorStyle{
574 Color: secondary,
575 Shape: tea.CursorBlock,
576 Blink: true,
577 },
578 }
579
580 s.TextArea = textarea.Styles{
581 Focused: textarea.StyleState{
582 Base: base,
583 Text: base,
584 LineNumber: base.Foreground(fgSubtle),
585 CursorLine: base,
586 CursorLineNumber: base.Foreground(fgSubtle),
587 Placeholder: base.Foreground(fgSubtle),
588 Prompt: base.Foreground(tertiary),
589 },
590 Blurred: textarea.StyleState{
591 Base: base,
592 Text: base.Foreground(fgMuted),
593 LineNumber: base.Foreground(fgMuted),
594 CursorLine: base,
595 CursorLineNumber: base.Foreground(fgMuted),
596 Placeholder: base.Foreground(fgSubtle),
597 Prompt: base.Foreground(fgMuted),
598 },
599 Cursor: textarea.CursorStyle{
600 Color: secondary,
601 Shape: tea.CursorBlock,
602 Blink: true,
603 },
604 }
605
606 s.Markdown = ansi.StyleConfig{
607 Document: ansi.StyleBlock{
608 StylePrimitive: ansi.StylePrimitive{
609 // BlockPrefix: "\n",
610 // BlockSuffix: "\n",
611 Color: stringPtr(charmtone.Smoke.Hex()),
612 },
613 // Margin: uintPtr(defaultMargin),
614 },
615 BlockQuote: ansi.StyleBlock{
616 StylePrimitive: ansi.StylePrimitive{},
617 Indent: uintPtr(1),
618 IndentToken: stringPtr("β "),
619 },
620 List: ansi.StyleList{
621 LevelIndent: defaultListIndent,
622 },
623 Heading: ansi.StyleBlock{
624 StylePrimitive: ansi.StylePrimitive{
625 BlockSuffix: "\n",
626 Color: stringPtr(charmtone.Malibu.Hex()),
627 Bold: boolPtr(true),
628 },
629 },
630 H1: ansi.StyleBlock{
631 StylePrimitive: ansi.StylePrimitive{
632 Prefix: " ",
633 Suffix: " ",
634 Color: stringPtr(charmtone.Zest.Hex()),
635 BackgroundColor: stringPtr(charmtone.Charple.Hex()),
636 Bold: boolPtr(true),
637 },
638 },
639 H2: ansi.StyleBlock{
640 StylePrimitive: ansi.StylePrimitive{
641 Prefix: "## ",
642 },
643 },
644 H3: ansi.StyleBlock{
645 StylePrimitive: ansi.StylePrimitive{
646 Prefix: "### ",
647 },
648 },
649 H4: ansi.StyleBlock{
650 StylePrimitive: ansi.StylePrimitive{
651 Prefix: "#### ",
652 },
653 },
654 H5: ansi.StyleBlock{
655 StylePrimitive: ansi.StylePrimitive{
656 Prefix: "##### ",
657 },
658 },
659 H6: ansi.StyleBlock{
660 StylePrimitive: ansi.StylePrimitive{
661 Prefix: "###### ",
662 Color: stringPtr(charmtone.Guac.Hex()),
663 Bold: boolPtr(false),
664 },
665 },
666 Strikethrough: ansi.StylePrimitive{
667 CrossedOut: boolPtr(true),
668 },
669 Emph: ansi.StylePrimitive{
670 Italic: boolPtr(true),
671 },
672 Strong: ansi.StylePrimitive{
673 Bold: boolPtr(true),
674 },
675 HorizontalRule: ansi.StylePrimitive{
676 Color: stringPtr(charmtone.Charcoal.Hex()),
677 Format: "\n--------\n",
678 },
679 Item: ansi.StylePrimitive{
680 BlockPrefix: "β’ ",
681 },
682 Enumeration: ansi.StylePrimitive{
683 BlockPrefix: ". ",
684 },
685 Task: ansi.StyleTask{
686 StylePrimitive: ansi.StylePrimitive{},
687 Ticked: "[β] ",
688 Unticked: "[ ] ",
689 },
690 Link: ansi.StylePrimitive{
691 Color: stringPtr(charmtone.Zinc.Hex()),
692 Underline: boolPtr(true),
693 },
694 LinkText: ansi.StylePrimitive{
695 Color: stringPtr(charmtone.Guac.Hex()),
696 Bold: boolPtr(true),
697 },
698 Image: ansi.StylePrimitive{
699 Color: stringPtr(charmtone.Cheeky.Hex()),
700 Underline: boolPtr(true),
701 },
702 ImageText: ansi.StylePrimitive{
703 Color: stringPtr(charmtone.Squid.Hex()),
704 Format: "Image: {{.text}} β",
705 },
706 Code: ansi.StyleBlock{
707 StylePrimitive: ansi.StylePrimitive{
708 Prefix: " ",
709 Suffix: " ",
710 Color: stringPtr(charmtone.Coral.Hex()),
711 BackgroundColor: stringPtr(charmtone.Charcoal.Hex()),
712 },
713 },
714 CodeBlock: ansi.StyleCodeBlock{
715 StyleBlock: ansi.StyleBlock{
716 StylePrimitive: ansi.StylePrimitive{
717 Color: stringPtr(charmtone.Charcoal.Hex()),
718 },
719 Margin: uintPtr(defaultMargin),
720 },
721 Chroma: &ansi.Chroma{
722 Text: ansi.StylePrimitive{
723 Color: stringPtr(charmtone.Smoke.Hex()),
724 },
725 Error: ansi.StylePrimitive{
726 Color: stringPtr(charmtone.Butter.Hex()),
727 BackgroundColor: stringPtr(charmtone.Sriracha.Hex()),
728 },
729 Comment: ansi.StylePrimitive{
730 Color: stringPtr(charmtone.Oyster.Hex()),
731 },
732 CommentPreproc: ansi.StylePrimitive{
733 Color: stringPtr(charmtone.Bengal.Hex()),
734 },
735 Keyword: ansi.StylePrimitive{
736 Color: stringPtr(charmtone.Malibu.Hex()),
737 },
738 KeywordReserved: ansi.StylePrimitive{
739 Color: stringPtr(charmtone.Pony.Hex()),
740 },
741 KeywordNamespace: ansi.StylePrimitive{
742 Color: stringPtr(charmtone.Pony.Hex()),
743 },
744 KeywordType: ansi.StylePrimitive{
745 Color: stringPtr(charmtone.Guppy.Hex()),
746 },
747 Operator: ansi.StylePrimitive{
748 Color: stringPtr(charmtone.Salmon.Hex()),
749 },
750 Punctuation: ansi.StylePrimitive{
751 Color: stringPtr(charmtone.Zest.Hex()),
752 },
753 Name: ansi.StylePrimitive{
754 Color: stringPtr(charmtone.Smoke.Hex()),
755 },
756 NameBuiltin: ansi.StylePrimitive{
757 Color: stringPtr(charmtone.Cheeky.Hex()),
758 },
759 NameTag: ansi.StylePrimitive{
760 Color: stringPtr(charmtone.Mauve.Hex()),
761 },
762 NameAttribute: ansi.StylePrimitive{
763 Color: stringPtr(charmtone.Hazy.Hex()),
764 },
765 NameClass: ansi.StylePrimitive{
766 Color: stringPtr(charmtone.Salt.Hex()),
767 Underline: boolPtr(true),
768 Bold: boolPtr(true),
769 },
770 NameDecorator: ansi.StylePrimitive{
771 Color: stringPtr(charmtone.Citron.Hex()),
772 },
773 NameFunction: ansi.StylePrimitive{
774 Color: stringPtr(charmtone.Guac.Hex()),
775 },
776 LiteralNumber: ansi.StylePrimitive{
777 Color: stringPtr(charmtone.Julep.Hex()),
778 },
779 LiteralString: ansi.StylePrimitive{
780 Color: stringPtr(charmtone.Cumin.Hex()),
781 },
782 LiteralStringEscape: ansi.StylePrimitive{
783 Color: stringPtr(charmtone.Bok.Hex()),
784 },
785 GenericDeleted: ansi.StylePrimitive{
786 Color: stringPtr(charmtone.Coral.Hex()),
787 },
788 GenericEmph: ansi.StylePrimitive{
789 Italic: boolPtr(true),
790 },
791 GenericInserted: ansi.StylePrimitive{
792 Color: stringPtr(charmtone.Guac.Hex()),
793 },
794 GenericStrong: ansi.StylePrimitive{
795 Bold: boolPtr(true),
796 },
797 GenericSubheading: ansi.StylePrimitive{
798 Color: stringPtr(charmtone.Squid.Hex()),
799 },
800 Background: ansi.StylePrimitive{
801 BackgroundColor: stringPtr(charmtone.Charcoal.Hex()),
802 },
803 },
804 },
805 Table: ansi.StyleTable{
806 StyleBlock: ansi.StyleBlock{
807 StylePrimitive: ansi.StylePrimitive{},
808 },
809 },
810 DefinitionDescription: ansi.StylePrimitive{
811 BlockPrefix: "\n ",
812 },
813 }
814
815 // PlainMarkdown style - muted colors on subtle background for thinking content.
816 plainBg := stringPtr(bgBaseLighter.Hex())
817 plainFg := stringPtr(fgMuted.Hex())
818 s.PlainMarkdown = ansi.StyleConfig{
819 Document: ansi.StyleBlock{
820 StylePrimitive: ansi.StylePrimitive{
821 Color: plainFg,
822 BackgroundColor: plainBg,
823 },
824 },
825 BlockQuote: ansi.StyleBlock{
826 StylePrimitive: ansi.StylePrimitive{
827 Color: plainFg,
828 BackgroundColor: plainBg,
829 },
830 Indent: uintPtr(1),
831 IndentToken: stringPtr("β "),
832 },
833 List: ansi.StyleList{
834 LevelIndent: defaultListIndent,
835 },
836 Heading: ansi.StyleBlock{
837 StylePrimitive: ansi.StylePrimitive{
838 BlockSuffix: "\n",
839 Bold: boolPtr(true),
840 Color: plainFg,
841 BackgroundColor: plainBg,
842 },
843 },
844 H1: ansi.StyleBlock{
845 StylePrimitive: ansi.StylePrimitive{
846 Prefix: " ",
847 Suffix: " ",
848 Bold: boolPtr(true),
849 Color: plainFg,
850 BackgroundColor: plainBg,
851 },
852 },
853 H2: ansi.StyleBlock{
854 StylePrimitive: ansi.StylePrimitive{
855 Prefix: "## ",
856 Color: plainFg,
857 BackgroundColor: plainBg,
858 },
859 },
860 H3: ansi.StyleBlock{
861 StylePrimitive: ansi.StylePrimitive{
862 Prefix: "### ",
863 Color: plainFg,
864 BackgroundColor: plainBg,
865 },
866 },
867 H4: ansi.StyleBlock{
868 StylePrimitive: ansi.StylePrimitive{
869 Prefix: "#### ",
870 Color: plainFg,
871 BackgroundColor: plainBg,
872 },
873 },
874 H5: ansi.StyleBlock{
875 StylePrimitive: ansi.StylePrimitive{
876 Prefix: "##### ",
877 Color: plainFg,
878 BackgroundColor: plainBg,
879 },
880 },
881 H6: ansi.StyleBlock{
882 StylePrimitive: ansi.StylePrimitive{
883 Prefix: "###### ",
884 Color: plainFg,
885 BackgroundColor: plainBg,
886 },
887 },
888 Strikethrough: ansi.StylePrimitive{
889 CrossedOut: boolPtr(true),
890 Color: plainFg,
891 BackgroundColor: plainBg,
892 },
893 Emph: ansi.StylePrimitive{
894 Italic: boolPtr(true),
895 Color: plainFg,
896 BackgroundColor: plainBg,
897 },
898 Strong: ansi.StylePrimitive{
899 Bold: boolPtr(true),
900 Color: plainFg,
901 BackgroundColor: plainBg,
902 },
903 HorizontalRule: ansi.StylePrimitive{
904 Format: "\n--------\n",
905 Color: plainFg,
906 BackgroundColor: plainBg,
907 },
908 Item: ansi.StylePrimitive{
909 BlockPrefix: "β’ ",
910 Color: plainFg,
911 BackgroundColor: plainBg,
912 },
913 Enumeration: ansi.StylePrimitive{
914 BlockPrefix: ". ",
915 Color: plainFg,
916 BackgroundColor: plainBg,
917 },
918 Task: ansi.StyleTask{
919 StylePrimitive: ansi.StylePrimitive{
920 Color: plainFg,
921 BackgroundColor: plainBg,
922 },
923 Ticked: "[β] ",
924 Unticked: "[ ] ",
925 },
926 Link: ansi.StylePrimitive{
927 Underline: boolPtr(true),
928 Color: plainFg,
929 BackgroundColor: plainBg,
930 },
931 LinkText: ansi.StylePrimitive{
932 Bold: boolPtr(true),
933 Color: plainFg,
934 BackgroundColor: plainBg,
935 },
936 Image: ansi.StylePrimitive{
937 Underline: boolPtr(true),
938 Color: plainFg,
939 BackgroundColor: plainBg,
940 },
941 ImageText: ansi.StylePrimitive{
942 Format: "Image: {{.text}} β",
943 Color: plainFg,
944 BackgroundColor: plainBg,
945 },
946 Code: ansi.StyleBlock{
947 StylePrimitive: ansi.StylePrimitive{
948 Prefix: " ",
949 Suffix: " ",
950 Color: plainFg,
951 BackgroundColor: plainBg,
952 },
953 },
954 CodeBlock: ansi.StyleCodeBlock{
955 StyleBlock: ansi.StyleBlock{
956 StylePrimitive: ansi.StylePrimitive{
957 Color: plainFg,
958 BackgroundColor: plainBg,
959 },
960 Margin: uintPtr(defaultMargin),
961 },
962 },
963 Table: ansi.StyleTable{
964 StyleBlock: ansi.StyleBlock{
965 StylePrimitive: ansi.StylePrimitive{
966 Color: plainFg,
967 BackgroundColor: plainBg,
968 },
969 },
970 },
971 DefinitionDescription: ansi.StylePrimitive{
972 BlockPrefix: "\n ",
973 Color: plainFg,
974 BackgroundColor: plainBg,
975 },
976 }
977
978 s.Help = help.Styles{
979 ShortKey: base.Foreground(fgMuted),
980 ShortDesc: base.Foreground(fgSubtle),
981 ShortSeparator: base.Foreground(border),
982 Ellipsis: base.Foreground(border),
983 FullKey: base.Foreground(fgMuted),
984 FullDesc: base.Foreground(fgSubtle),
985 FullSeparator: base.Foreground(border),
986 }
987
988 s.Diff = diffview.Style{
989 DividerLine: diffview.LineStyle{
990 LineNumber: lipgloss.NewStyle().
991 Foreground(fgHalfMuted).
992 Background(bgBaseLighter),
993 Code: lipgloss.NewStyle().
994 Foreground(fgHalfMuted).
995 Background(bgBaseLighter),
996 },
997 MissingLine: diffview.LineStyle{
998 LineNumber: lipgloss.NewStyle().
999 Background(bgBaseLighter),
1000 Code: lipgloss.NewStyle().
1001 Background(bgBaseLighter),
1002 },
1003 EqualLine: diffview.LineStyle{
1004 LineNumber: lipgloss.NewStyle().
1005 Foreground(fgMuted).
1006 Background(bgBase),
1007 Code: lipgloss.NewStyle().
1008 Foreground(fgMuted).
1009 Background(bgBase),
1010 },
1011 InsertLine: diffview.LineStyle{
1012 LineNumber: lipgloss.NewStyle().
1013 Foreground(lipgloss.Color("#629657")).
1014 Background(lipgloss.Color("#2b322a")),
1015 Symbol: lipgloss.NewStyle().
1016 Foreground(lipgloss.Color("#629657")).
1017 Background(lipgloss.Color("#323931")),
1018 Code: lipgloss.NewStyle().
1019 Background(lipgloss.Color("#323931")),
1020 },
1021 DeleteLine: diffview.LineStyle{
1022 LineNumber: lipgloss.NewStyle().
1023 Foreground(lipgloss.Color("#a45c59")).
1024 Background(lipgloss.Color("#312929")),
1025 Symbol: lipgloss.NewStyle().
1026 Foreground(lipgloss.Color("#a45c59")).
1027 Background(lipgloss.Color("#383030")),
1028 Code: lipgloss.NewStyle().
1029 Background(lipgloss.Color("#383030")),
1030 },
1031 }
1032
1033 s.FilePicker = filepicker.Styles{
1034 DisabledCursor: base.Foreground(fgMuted),
1035 Cursor: base.Foreground(fgBase),
1036 Symlink: base.Foreground(fgSubtle),
1037 Directory: base.Foreground(primary),
1038 File: base.Foreground(fgBase),
1039 DisabledFile: base.Foreground(fgMuted),
1040 DisabledSelected: base.Background(bgOverlay).Foreground(fgMuted),
1041 Permission: base.Foreground(fgMuted),
1042 Selected: base.Background(primary).Foreground(fgBase),
1043 FileSize: base.Foreground(fgMuted),
1044 EmptyDirectory: base.Foreground(fgMuted).PaddingLeft(2).SetString("Empty directory"),
1045 }
1046
1047 // borders
1048 s.FocusedMessageBorder = lipgloss.Border{Left: BorderThick}
1049
1050 // text presets
1051 s.Base = lipgloss.NewStyle().Foreground(fgBase)
1052 s.Muted = lipgloss.NewStyle().Foreground(fgMuted)
1053 s.HalfMuted = lipgloss.NewStyle().Foreground(fgHalfMuted)
1054 s.Subtle = lipgloss.NewStyle().Foreground(fgSubtle)
1055
1056 s.WindowTooSmall = s.Muted
1057
1058 // tag presets
1059 s.TagBase = lipgloss.NewStyle().Padding(0, 1).Foreground(white)
1060 s.TagError = s.TagBase.Background(redDark)
1061 s.TagInfo = s.TagBase.Background(blueLight)
1062
1063 // Compact header styles
1064 s.Header.Charm = base.Foreground(secondary)
1065 s.Header.Diagonals = base.Foreground(primary)
1066 s.Header.Percentage = s.Muted
1067 s.Header.Keystroke = s.Muted
1068 s.Header.KeystrokeTip = s.Subtle
1069 s.Header.WorkingDir = s.Muted
1070 s.Header.Separator = s.Subtle
1071
1072 s.CompactDetails.Title = s.Base
1073 s.CompactDetails.View = s.Base.Padding(0, 1, 1, 1).Border(lipgloss.RoundedBorder()).BorderForeground(borderFocus)
1074 s.CompactDetails.Version = s.Muted
1075
1076 // panels
1077 s.PanelMuted = s.Muted.Background(bgBaseLighter)
1078 s.PanelBase = lipgloss.NewStyle().Background(bgBase)
1079
1080 // code line number
1081 s.LineNumber = lipgloss.NewStyle().Foreground(fgMuted).Background(bgBase).PaddingRight(1).PaddingLeft(1)
1082
1083 // Tool calls
1084 s.ToolCallPending = lipgloss.NewStyle().Foreground(greenDark).SetString(ToolPending)
1085 s.ToolCallError = lipgloss.NewStyle().Foreground(redDark).SetString(ToolError)
1086 s.ToolCallSuccess = lipgloss.NewStyle().Foreground(green).SetString(ToolSuccess)
1087 // Cancelled uses muted tone but same glyph as pending
1088 s.ToolCallCancelled = s.Muted.SetString(ToolPending)
1089 s.EarlyStateMessage = s.Subtle.PaddingLeft(2)
1090
1091 // Tool rendering styles
1092 s.Tool.IconPending = base.Foreground(greenDark).SetString(ToolPending)
1093 s.Tool.IconSuccess = base.Foreground(green).SetString(ToolSuccess)
1094 s.Tool.IconError = base.Foreground(redDark).SetString(ToolError)
1095 s.Tool.IconCancelled = s.Muted.SetString(ToolPending)
1096
1097 s.Tool.NameNormal = base.Foreground(blue)
1098 s.Tool.NameNested = base.Foreground(fgHalfMuted)
1099
1100 s.Tool.ParamMain = s.Subtle
1101 s.Tool.ParamKey = s.Subtle
1102
1103 // Content rendering - prepared styles that accept width parameter
1104 s.Tool.ContentLine = s.Muted.Background(bgBaseLighter)
1105 s.Tool.ContentTruncation = s.Muted.Background(bgBaseLighter)
1106 s.Tool.ContentCodeLine = s.Base.Background(bgBase)
1107 s.Tool.ContentCodeTruncation = s.Muted.Background(bgBase).PaddingLeft(2)
1108 s.Tool.ContentCodeBg = bgBase
1109 s.Tool.Body = base.PaddingLeft(2)
1110
1111 // Deprecated - kept for backward compatibility
1112 s.Tool.ContentBg = s.Muted.Background(bgBaseLighter)
1113 s.Tool.ContentText = s.Muted
1114 s.Tool.ContentLineNumber = base.Foreground(fgMuted).Background(bgBase).PaddingRight(1).PaddingLeft(1)
1115
1116 s.Tool.StateWaiting = base.Foreground(fgSubtle)
1117 s.Tool.StateCancelled = base.Foreground(fgSubtle)
1118
1119 s.Tool.ErrorTag = base.Padding(0, 1).Background(red).Foreground(white)
1120 s.Tool.ErrorMessage = base.Foreground(fgHalfMuted)
1121
1122 // Diff and multi-edit styles
1123 s.Tool.DiffTruncation = s.Muted.Background(bgBaseLighter).PaddingLeft(2)
1124 s.Tool.NoteTag = base.Padding(0, 1).Background(info).Foreground(white)
1125 s.Tool.NoteMessage = base.Foreground(fgHalfMuted)
1126
1127 // Job header styles
1128 s.Tool.JobIconPending = base.Foreground(greenDark)
1129 s.Tool.JobIconError = base.Foreground(redDark)
1130 s.Tool.JobIconSuccess = base.Foreground(green)
1131 s.Tool.JobToolName = base.Foreground(blue)
1132 s.Tool.JobAction = base.Foreground(blueDark)
1133 s.Tool.JobPID = s.Muted
1134 s.Tool.JobDescription = s.Subtle
1135
1136 // Agent task styles
1137 s.Tool.AgentTaskTag = base.Bold(true).Padding(0, 1).MarginLeft(2).Background(blueLight).Foreground(white)
1138 s.Tool.AgentPrompt = s.Muted
1139
1140 // Agentic fetch styles
1141 s.Tool.AgenticFetchPromptTag = base.Bold(true).Padding(0, 1).MarginLeft(2).Background(green).Foreground(border)
1142
1143 // Todo styles
1144 s.Tool.TodoRatio = base.Foreground(blueDark)
1145 s.Tool.TodoCompletedIcon = base.Foreground(green)
1146 s.Tool.TodoInProgressIcon = base.Foreground(greenDark)
1147 s.Tool.TodoPendingIcon = base.Foreground(fgMuted)
1148
1149 // MCP styles
1150 s.Tool.MCPName = base.Foreground(blue)
1151 s.Tool.MCPToolName = base.Foreground(blueDark)
1152 s.Tool.MCPArrow = base.Foreground(blue).SetString(ArrowRightIcon)
1153
1154 // Buttons
1155 s.ButtonFocus = lipgloss.NewStyle().Foreground(white).Background(secondary)
1156 s.ButtonBlur = s.Base.Background(bgSubtle)
1157
1158 // Borders
1159 s.BorderFocus = lipgloss.NewStyle().BorderForeground(borderFocus).Border(lipgloss.RoundedBorder()).Padding(1, 2)
1160
1161 // Editor
1162 s.EditorPromptNormalFocused = lipgloss.NewStyle().Foreground(greenDark).SetString("::: ")
1163 s.EditorPromptNormalBlurred = s.EditorPromptNormalFocused.Foreground(fgMuted)
1164 s.EditorPromptYoloIconFocused = lipgloss.NewStyle().MarginRight(1).Foreground(charmtone.Oyster).Background(charmtone.Citron).Bold(true).SetString(" ! ")
1165 s.EditorPromptYoloIconBlurred = s.EditorPromptYoloIconFocused.Foreground(charmtone.Pepper).Background(charmtone.Squid)
1166 s.EditorPromptYoloDotsFocused = lipgloss.NewStyle().MarginRight(1).Foreground(charmtone.Zest).SetString(":::")
1167 s.EditorPromptYoloDotsBlurred = s.EditorPromptYoloDotsFocused.Foreground(charmtone.Squid)
1168
1169 s.RadioOn = s.HalfMuted.SetString(RadioOn)
1170 s.RadioOff = s.HalfMuted.SetString(RadioOff)
1171
1172 // Logo colors
1173 s.LogoFieldColor = primary
1174 s.LogoTitleColorA = secondary
1175 s.LogoTitleColorB = primary
1176 s.LogoCharmColor = secondary
1177 s.LogoVersionColor = primary
1178
1179 // Section
1180 s.Section.Title = s.Subtle
1181 s.Section.Line = s.Base.Foreground(charmtone.Charcoal)
1182
1183 // Initialize
1184 s.Initialize.Header = s.Base
1185 s.Initialize.Content = s.Muted
1186 s.Initialize.Accent = s.Base.Foreground(greenDark)
1187
1188 // LSP and MCP status.
1189 s.ItemOfflineIcon = lipgloss.NewStyle().Foreground(charmtone.Squid).SetString("β")
1190 s.ItemBusyIcon = s.ItemOfflineIcon.Foreground(charmtone.Citron)
1191 s.ItemErrorIcon = s.ItemOfflineIcon.Foreground(charmtone.Coral)
1192 s.ItemOnlineIcon = s.ItemOfflineIcon.Foreground(charmtone.Guac)
1193
1194 // LSP
1195 s.LSP.ErrorDiagnostic = s.Base.Foreground(redDark)
1196 s.LSP.WarningDiagnostic = s.Base.Foreground(warning)
1197 s.LSP.HintDiagnostic = s.Base.Foreground(fgHalfMuted)
1198 s.LSP.InfoDiagnostic = s.Base.Foreground(info)
1199
1200 // Files
1201 s.Files.Path = s.Muted
1202 s.Files.Additions = s.Base.Foreground(greenDark)
1203 s.Files.Deletions = s.Base.Foreground(redDark)
1204
1205 // Chat
1206 messageFocussedBorder := lipgloss.Border{
1207 Left: "β",
1208 }
1209
1210 s.Chat.Message.NoContent = lipgloss.NewStyle().Foreground(fgBase)
1211 s.Chat.Message.UserBlurred = s.Chat.Message.NoContent.PaddingLeft(1).BorderLeft(true).
1212 BorderForeground(primary).BorderStyle(normalBorder)
1213 s.Chat.Message.UserFocused = s.Chat.Message.NoContent.PaddingLeft(1).BorderLeft(true).
1214 BorderForeground(primary).BorderStyle(messageFocussedBorder)
1215 s.Chat.Message.AssistantBlurred = s.Chat.Message.NoContent.PaddingLeft(2)
1216 s.Chat.Message.AssistantFocused = s.Chat.Message.NoContent.PaddingLeft(1).BorderLeft(true).
1217 BorderForeground(greenDark).BorderStyle(messageFocussedBorder)
1218 s.Chat.Message.Thinking = lipgloss.NewStyle().MaxHeight(10)
1219 s.Chat.Message.ErrorTag = lipgloss.NewStyle().Padding(0, 1).
1220 Background(red).Foreground(white)
1221 s.Chat.Message.ErrorTitle = lipgloss.NewStyle().Foreground(fgHalfMuted)
1222 s.Chat.Message.ErrorDetails = lipgloss.NewStyle().Foreground(fgSubtle)
1223
1224 // Message item styles
1225 s.Chat.Message.ToolCallFocused = s.Muted.PaddingLeft(1).
1226 BorderStyle(messageFocussedBorder).
1227 BorderLeft(true).
1228 BorderForeground(greenDark)
1229 s.Chat.Message.ToolCallBlurred = s.Muted.PaddingLeft(2)
1230 // No padding or border for compact tool calls within messages
1231 s.Chat.Message.ToolCallCompact = s.Muted
1232 s.Chat.Message.SectionHeader = s.Base.PaddingLeft(2)
1233 s.Chat.Message.AssistantInfoIcon = s.Subtle
1234 s.Chat.Message.AssistantInfoModel = s.Muted
1235 s.Chat.Message.AssistantInfoProvider = s.Subtle
1236 s.Chat.Message.AssistantInfoDuration = s.Subtle
1237
1238 // Thinking section styles
1239 s.Chat.Message.ThinkingBox = s.Subtle.Background(bgBaseLighter)
1240 s.Chat.Message.ThinkingTruncationHint = s.Muted
1241 s.Chat.Message.ThinkingFooterTitle = s.Muted
1242 s.Chat.Message.ThinkingFooterDuration = s.Subtle
1243
1244 // Text selection.
1245 s.TextSelection = lipgloss.NewStyle().Foreground(charmtone.Salt).Background(charmtone.Charple)
1246
1247 // Dialog styles
1248 s.Dialog.Title = base.Padding(0, 1).Foreground(primary)
1249 s.Dialog.TitleText = base.Foreground(primary)
1250 s.Dialog.TitleError = base.Foreground(red)
1251 s.Dialog.TitleAccent = base.Foreground(green).Bold(true)
1252 s.Dialog.View = base.Border(lipgloss.RoundedBorder()).BorderForeground(borderFocus)
1253 s.Dialog.PrimaryText = base.Padding(0, 1).Foreground(primary)
1254 s.Dialog.SecondaryText = base.Padding(0, 1).Foreground(fgSubtle)
1255 s.Dialog.HelpView = base.Padding(0, 1).AlignHorizontal(lipgloss.Left)
1256 s.Dialog.Help.ShortKey = base.Foreground(fgMuted)
1257 s.Dialog.Help.ShortDesc = base.Foreground(fgSubtle)
1258 s.Dialog.Help.ShortSeparator = base.Foreground(border)
1259 s.Dialog.Help.Ellipsis = base.Foreground(border)
1260 s.Dialog.Help.FullKey = base.Foreground(fgMuted)
1261 s.Dialog.Help.FullDesc = base.Foreground(fgSubtle)
1262 s.Dialog.Help.FullSeparator = base.Foreground(border)
1263 s.Dialog.NormalItem = base.Padding(0, 1).Foreground(fgBase)
1264 s.Dialog.SelectedItem = base.Padding(0, 1).Background(primary).Foreground(fgBase)
1265 s.Dialog.InputPrompt = base.Margin(1, 1)
1266
1267 s.Dialog.List = base.Margin(0, 0, 1, 0)
1268 s.Dialog.ContentPanel = base.Background(bgSubtle).Foreground(fgBase).Padding(1, 2)
1269 s.Dialog.Spinner = base.Foreground(secondary)
1270 s.Dialog.ScrollbarThumb = base.Foreground(secondary)
1271 s.Dialog.ScrollbarTrack = base.Foreground(border)
1272
1273 s.Dialog.ImagePreview = lipgloss.NewStyle().Padding(0, 1).Foreground(fgSubtle)
1274
1275 s.Dialog.Arguments.Content = base.Padding(1)
1276 s.Dialog.Arguments.Description = base.MarginBottom(1).MaxHeight(3)
1277 s.Dialog.Arguments.InputLabelBlurred = base.Foreground(fgMuted)
1278 s.Dialog.Arguments.InputLabelFocused = base.Bold(true)
1279 s.Dialog.Arguments.InputRequiredMarkBlurred = base.Foreground(fgMuted).SetString("*")
1280 s.Dialog.Arguments.InputRequiredMarkFocused = base.Foreground(primary).Bold(true).SetString("*")
1281
1282 s.Dialog.Sessions.DeletingTitle = s.Dialog.Title.Foreground(red)
1283 s.Dialog.Sessions.DeletingView = s.Dialog.View.BorderForeground(red)
1284 s.Dialog.Sessions.DeletingMessage = s.Base.Padding(1)
1285 s.Dialog.Sessions.DeletingTitleGradientFromColor = red
1286 s.Dialog.Sessions.DeletingTitleGradientToColor = s.Primary
1287 s.Dialog.Sessions.DeletingItemBlurred = s.Dialog.NormalItem.Foreground(fgSubtle)
1288 s.Dialog.Sessions.DeletingItemFocused = s.Dialog.SelectedItem.Background(red)
1289
1290 s.Status.Help = lipgloss.NewStyle().Padding(0, 1)
1291 s.Status.SuccessIndicator = base.Foreground(bgSubtle).Background(green).Padding(0, 1).Bold(true).SetString("OKAY!")
1292 s.Status.InfoIndicator = s.Status.SuccessIndicator
1293 s.Status.UpdateIndicator = s.Status.SuccessIndicator.SetString("HEY!")
1294 s.Status.WarnIndicator = s.Status.SuccessIndicator.Foreground(bgOverlay).Background(yellow).SetString("WARNING")
1295 s.Status.ErrorIndicator = s.Status.SuccessIndicator.Foreground(bgBase).Background(red).SetString("ERROR")
1296 s.Status.SuccessMessage = base.Foreground(bgSubtle).Background(greenDark).Padding(0, 1)
1297 s.Status.InfoMessage = s.Status.SuccessMessage
1298 s.Status.UpdateMessage = s.Status.SuccessMessage
1299 s.Status.WarnMessage = s.Status.SuccessMessage.Foreground(bgOverlay).Background(warning)
1300 s.Status.ErrorMessage = s.Status.SuccessMessage.Foreground(white).Background(redDark)
1301
1302 // Completions styles
1303 s.Completions.Normal = base.Background(bgSubtle).Foreground(fgBase)
1304 s.Completions.Focused = base.Background(primary).Foreground(white)
1305 s.Completions.Match = base.Underline(true)
1306
1307 // Attachments styles
1308 attachmentIconStyle := base.Foreground(bgSubtle).Background(green).Padding(0, 1)
1309 s.Attachments.Image = attachmentIconStyle.SetString(ImageIcon)
1310 s.Attachments.Text = attachmentIconStyle.SetString(TextIcon)
1311 s.Attachments.Normal = base.Padding(0, 1).MarginRight(1).Background(fgMuted).Foreground(fgBase)
1312 s.Attachments.Deleting = base.Padding(0, 1).Bold(true).Background(red).Foreground(fgBase)
1313
1314 // Pills styles
1315 s.Pills.Base = base.Padding(0, 1)
1316 s.Pills.Focused = base.Padding(0, 1).BorderStyle(lipgloss.RoundedBorder()).BorderForeground(bgOverlay)
1317 s.Pills.Blurred = base.Padding(0, 1).BorderStyle(lipgloss.HiddenBorder())
1318 s.Pills.QueueItemPrefix = s.Muted.SetString(" β’")
1319 s.Pills.HelpKey = s.Muted
1320 s.Pills.HelpText = s.Subtle
1321 s.Pills.Area = base
1322 s.Pills.TodoSpinner = base.Foreground(greenDark)
1323
1324 return s
1325}
1326
1327// Helper functions for style pointers
1328func boolPtr(b bool) *bool { return &b }
1329func stringPtr(s string) *string { return &s }
1330func uintPtr(u uint) *uint { return &u }
1331func chromaStyle(style ansi.StylePrimitive) string {
1332 var s string
1333
1334 if style.Color != nil {
1335 s = *style.Color
1336 }
1337 if style.BackgroundColor != nil {
1338 if s != "" {
1339 s += " "
1340 }
1341 s += "bg:" + *style.BackgroundColor
1342 }
1343 if style.Italic != nil && *style.Italic {
1344 if s != "" {
1345 s += " "
1346 }
1347 s += "italic"
1348 }
1349 if style.Bold != nil && *style.Bold {
1350 if s != "" {
1351 s += " "
1352 }
1353 s += "bold"
1354 }
1355 if style.Underline != nil && *style.Underline {
1356 if s != "" {
1357 s += " "
1358 }
1359 s += "underline"
1360 }
1361
1362 return s
1363}