From 015b0b0d17548b5a42b1dc56616cc933f8784c49 Mon Sep 17 00:00:00 2001 From: Christian Rocha Date: Wed, 13 Jul 2022 17:24:32 -0700 Subject: [PATCH] chore: de-emphasize Glamour headers --- ui/common/style.go | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/ui/common/style.go b/ui/common/style.go index 1e2c911a79fe31f07f144245667a9459d8091ac1..8b91d9afa08df6466414edaae1bb7da6ad686956 100644 --- a/ui/common/style.go +++ b/ui/common/style.go @@ -5,15 +5,23 @@ import ( gansi "github.com/charmbracelet/glamour/ansi" ) +func strptr(s string) *string { + return &s +} + // StyleConfig returns the default Glamour style configuration. func StyleConfig() gansi.StyleConfig { - noColor := "" + noColor := strptr("") s := glamour.DarkStyleConfig - s.Document.StylePrimitive.Color = &noColor - s.CodeBlock.Chroma.Text.Color = &noColor - s.CodeBlock.Chroma.Name.Color = &noColor + s.H1.BackgroundColor = noColor + s.H1.Prefix = "# " + s.H1.Suffix = "" + s.H1.Color = strptr("39") + s.Document.StylePrimitive.Color = noColor + s.CodeBlock.Chroma.Text.Color = noColor + s.CodeBlock.Chroma.Name.Color = noColor // This fixes an issue with the default style config. For example // highlighting empty spaces with red in Dockerfile type. - s.CodeBlock.Chroma.Error.BackgroundColor = &noColor + s.CodeBlock.Chroma.Error.BackgroundColor = noColor return s }