Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions internal/display/display.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,11 @@ var (
faint = ac("#8C959F", "#4E4E4E")

// Secondary palette tokens used across multiple files.
accent = ac("#2E59A1", "#87AFFF") // nameservers, headers, DNS records
muted = ac("#57606A", "#A8A8A8") // TXT records, redirect URLs, mail records
border = ac("#D0D7DE", "#3A3A3A") // box and panel borders
tabGray = ac("#57606A", "#A0A0A0") // inactive tab text
accent = ac("#2E59A1", "#87AFFF") // nameservers, headers, DNS records
muted = ac("#57606A", "#A8A8A8") // TXT records, redirect URLs, mail records
mutedAlt = ac("#8C959F", "#7A7A7A") // alternate TXT shade for zebra striping
border = ac("#D0D7DE", "#3A3A3A") // box and panel borders
tabGray = ac("#57606A", "#A0A0A0") // inactive tab text

// Styles
domainStyle = lipgloss.NewStyle().
Expand Down Expand Up @@ -85,6 +86,9 @@ var (
txtStyle = lipgloss.NewStyle().
Foreground(muted)

txtStyleAlt = lipgloss.NewStyle().
Foreground(mutedAlt)

dimStyle = lipgloss.NewStyle().
Foreground(dim)

Expand Down
9 changes: 7 additions & 2 deletions internal/display/dns.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,18 @@ func RenderDNS(records *dns.Records) string {
hasRecords = true
b.WriteString("\n")
b.WriteString(section("TXT"))
for _, txt := range records.TXT {
for i, txt := range records.TXT {
// Truncate long TXT records for display
display := txt
if len(display) > 60 {
display = display[:57] + "..."
}
b.WriteString(row("", txtStyle.Render(display)))
// Alternate shades so adjacent records are easy to tell apart.
style := txtStyle
if i%2 == 1 {
style = txtStyleAlt
}
b.WriteString(row("", style.Render(display)))
}
}

Expand Down