mirror of
https://gitea.com/gitea/tea.git
synced 2026-03-11 00:03:32 +01:00
Reviewed-on: https://gitea.com/gitea/tea/pulls/923 Reviewed-by: techknowlogick <9+techknowlogick@noreply.gitea.com> Co-authored-by: Michal Suchanek <msuchanek@suse.de> Co-committed-by: Michal Suchanek <msuchanek@suse.de>
23 lines
567 B
Go
23 lines
567 B
Go
// Copyright 2025 The Gitea Authors. All rights reserved.
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
package interact
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
|
|
"code.gitea.io/tea/modules/theme"
|
|
|
|
"charm.land/lipgloss/v2"
|
|
)
|
|
|
|
// printTitleAndContent prints a title and content with the gitea theme
|
|
func printTitleAndContent(title, content string) {
|
|
hasDarkBG := lipgloss.HasDarkBackground(os.Stdin, os.Stdout)
|
|
style := lipgloss.NewStyle().
|
|
Foreground(theme.GetTheme().Theme(hasDarkBG).Blurred.Title.GetForeground()).Bold(true).
|
|
Padding(0, 1)
|
|
fmt.Print(style.Render(title), content+"\n")
|
|
}
|