Skip to content

Commit f90b51d

Browse files
A-Lamiamehalter
authored andcommitted
feat: add distinct highlights for popups and floats
1 parent a631244 commit f90b51d

File tree

7 files changed

+175
-69
lines changed

7 files changed

+175
-69
lines changed

lua/astrotheme/groups/base.lua

Lines changed: 158 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,140 @@
11
local function callback(opts)
22
return {
3+
--------------------
4+
--- Normal
5+
--------------------
36
Normal = { fg = C.syntax.text, bg = opts.transparent and C.none or C.ui.base },
4-
NormalFloat = {
5-
fg = C.ui.text,
6-
bg = opts.inactive and C.ui.base or C.ui.float,
7-
},
87
NormalNC = {
98
fg = C.syntax.text,
109
bg = (opts.transparent and opts.inactive and C.ui.inactive_base)
1110
or (opts.transparent and C.none)
1211
or (opts.inactive and C.ui.inactive_base)
1312
or C.ui.base,
1413
},
15-
Title = { fg = C.ui.accent, bg = C.none, bold = true },
14+
15+
--------------------
16+
--- Float
17+
--------------------
18+
FloatTitle = {
19+
fg = (opts.title_invert and C.ui.tool) or C.ui.title,
20+
bg = (opts.title_invert and C.ui.title)
21+
or (opts.float and C.ui.float)
22+
or (opts.transparent and C.none)
23+
or C.ui.base,
24+
blend = vim.o.winblend or 0,
25+
bold = true,
26+
},
27+
FloatBorder = {
28+
fg = (opts.border and opts.float and C.ui.border) or (opts.float and C.ui.float) or C.ui.base,
29+
bg = (opts.float and C.ui.float) or (opts.transparent and C.none) or C.ui.base,
30+
blend = vim.o.winblend or 0,
31+
},
32+
NormalFloat = {
33+
fg = C.ui.text,
34+
bg = (opts.float and C.ui.float) or (opts.transparent and C.none) or C.ui.base,
35+
},
36+
37+
--------------------
38+
--- Popup
39+
--------------------
40+
PopupTitle = {
41+
fg = (opts.title_invert and C.ui.tool) or C.ui.title,
42+
bg = (opts.title_invert and C.ui.title)
43+
or (opts.inactive and C.ui.base)
44+
or (opts.popup and C.ui.popup)
45+
or (opts.transparent and C.none)
46+
or C.ui.base,
47+
blend = vim.o.winblend or 0,
48+
bold = true,
49+
},
50+
PopupBorder = {
51+
fg = (opts.border and C.ui.border) or (opts.inactive and C.ui.base) or (opts.popup and C.ui.popup) or C.ui.base,
52+
bg = (opts.inactive and C.ui.base) or (opts.popup and C.ui.popup) or (opts.transparent and C.none) or C.ui.base,
53+
blend = vim.o.winblend or 0,
54+
},
55+
NormalPopup = {
56+
fg = C.ui.text,
57+
bg = (opts.inactive and C.ui.base) or (opts.popup and C.ui.popup) or (opts.transparent and C.none) or C.ui.base,
58+
},
59+
60+
--------------------
61+
--- Text
62+
--------------------
63+
Title = {
64+
fg = (opts.title_invert and C.ui.tool) or C.ui.title,
65+
bg = (opts.title_invert and C.ui.title) or C.ui.tool,
66+
blend = vim.o.winblend or 0,
67+
bold = true,
68+
},
69+
70+
Italic = { italic = true },
1671
Bold = { bold = true },
72+
73+
Conceal = { fg = C.ui.text_inactive, bg = C.none },
74+
SpecialKey = { fg = C.ui.text, bg = C.none },
75+
76+
----------------
77+
--- Tab
78+
----------------
79+
TabLine = { fg = C.ui.text_inactive, bg = C.ui.tabline },
80+
TabLineSel = { fg = C.ui.text_active, bg = C.ui.base, bold = true, italic = true },
81+
TabLineFill = { fg = C.none, bg = C.ui.tabline },
82+
83+
----------------
84+
--- Winbar
85+
----------------
86+
WinBar = { fg = C.ui.winbar, bg = C.none },
87+
WinBarNC = {
88+
fg = C.ui.text_inactive,
89+
bg = (opts.transparent and opts.inactive and C.ui.inactive_base)
90+
or (opts.transparent and C.none)
91+
or (opts.inactive and C.ui.inactive_base)
92+
or C.ui.base,
93+
},
94+
95+
--------------------
96+
--- Status
97+
--------------------
98+
StatusLine = { fg = C.ui.text, bg = C.ui.statusline },
99+
StatusLineNC = { fg = C.ui.text_inactive, bg = C.none },
100+
StatusInactive = { fg = C.ui.tabline, bg = C.ui.text_inactive }, -- TODO: find better inactive color
101+
StatusNormal = { fg = C.ui.tabline, bg = C.ui.blue },
102+
StatusInsert = { fg = C.ui.tabline, bg = C.ui.green },
103+
StatusVisual = { fg = C.ui.tabline, bg = C.ui.purple },
104+
StatusReplace = { fg = C.ui.tabline, bg = C.ui.red },
105+
StatusCommand = { fg = C.ui.tabline, bg = C.ui.yellow },
106+
StatusTerminal = { link = "StatusInsert" },
107+
108+
--------------------
109+
--- UI
110+
--------------------
17111
Cursor = { fg = C.ui.base, bg = C.syntax.text },
18112
CursorIM = { link = "Cursor" },
19113
lCursor = { link = "Cursor" },
20-
ColorColumn = { fg = C.none, bg = C.ui.current_line }, -- NOTE: Find better color
21-
CursorLineNr = { fg = C.ui.text_active, bg = C.none }, --NOTE: active line number
22-
Conceal = { fg = C.ui.text_inactive, bg = C.none },
23-
CursorColumn = { fg = C.none, bg = C.ui.current_line },
24-
CursorLine = { fg = C.none, bg = C.ui.current_line },
25-
Directory = { fg = C.ui.blue, bg = C.none },
114+
115+
CursorLineNr = { fg = C.ui.text_active, bg = C.none }, -- Active line number
116+
LineNr = { fg = C.ui.none_text, bg = C.none }, -- Line numbers
117+
118+
WinSeparator = {
119+
fg = C.ui.split,
120+
bg = opts.transparent and C.none or C.ui.base,
121+
bold = false,
122+
},
123+
VertSplit = {
124+
fg = C.ui.split,
125+
bg = opts.transparent and C.none or C.ui.base,
126+
},
127+
128+
Folded = { fg = C.ui.none_text, bg = C.none },
129+
FoldColumn = { fg = C.ui.none_text, bg = C.none },
130+
131+
NonText = { fg = C.ui.none_text, bg = C.none },
132+
EndOfBuffer = { fg = C.ui.base, bg = C.none },
133+
SignColumn = { fg = C.none, bg = C.none },
134+
135+
--------------------
136+
--- Diagnostics
137+
--------------------
26138
DiffAdd = { fg = C.ui.base, bg = C.syntax.green },
27139
DiffChange = { fg = C.ui.base, bg = C.syntax.yellow },
28140
DiffDelete = { fg = C.ui.base, bg = C.syntax.red },
@@ -35,59 +147,52 @@ local function callback(opts)
35147
DiffFile = { fg = C.syntax.blue },
36148
DiffLine = { fg = C.syntax.text }, -- NOTE: Find better color
37149
DiffIndexLine = { fg = C.syntax.cyan },
150+
38151
ErrorMsg = { fg = C.syntax.red, bg = C.none },
39-
WinSeparator = { fg = C.ui.split, bg = opts.transparent and C.none or C.ui.base, bold = false },
40-
Folded = { fg = C.ui.none_text, bg = C.none },
41-
FoldColumn = { fg = C.ui.none_text, bg = C.none },
42-
Italic = { italic = true },
43-
IncSearch = { fg = C.ui.base, bg = C.ui.purple },
44-
CurSearch = { link = "IncSearch" },
45-
LineNr = { fg = C.ui.none_text, bg = C.none },
46-
NonText = { fg = C.ui.none_text, bg = C.none },
152+
WarningMsg = { fg = C.ui.yellow, bg = C.none },
153+
Question = { fg = C.ui.purple, bg = C.none },
154+
155+
--------------------
156+
--- Menu
157+
--------------------
47158
Pmenu = { fg = C.ui.text, bg = C.ui.popup },
48159
PmenuSel = { fg = C.none, bg = C.ui.current_line },
49160
PmenuSbar = { fg = C.none, bg = C.ui.tabline },
50161
PmenuThumb = { fg = C.none, bg = C.ui.scrollbar },
51-
Question = { fg = C.ui.purple, bg = C.none },
52-
QuickFixLine = { fg = C.ui.base, bg = C.ui.yellow },
162+
163+
WildMenu = { fg = C.ui.base, bg = C.syntax.blue },
164+
165+
--------------------
166+
--- Search & Select
167+
--------------------
53168
Search = { fg = C.none, bg = C.ui.selection },
54-
SignColumn = { fg = C.none, bg = C.none },
55-
SpecialKey = { fg = C.ui.text, bg = C.none },
169+
IncSearch = { fg = C.ui.base, bg = C.ui.purple },
170+
CurSearch = { link = "IncSearch" },
171+
MatchParen = { fg = C.none, bg = C.ui.highlight },
172+
Visual = { fg = C.none, bg = C.ui.selection },
173+
VisualNOS = { fg = C.ui.selection, bg = C.none },
174+
175+
--------------------
176+
--- Highlights
177+
--------------------
178+
CursorColumn = { fg = C.none, bg = C.ui.current_line },
179+
ColorColumn = { fg = C.none, bg = C.ui.current_line }, -- NOTE: Find better color
180+
CursorLine = { fg = C.none, bg = C.ui.current_line },
181+
182+
--------------------
183+
--- Spell
184+
--------------------
56185
SpellBad = { undercurl = true },
57186
SpellCap = { undercurl = true },
58187
SpellLocal = { undercurl = true },
59188
SpellRare = { undercurl = true },
60-
StatusLine = { fg = C.ui.text, bg = C.ui.statusline },
61-
StatusLineNC = { fg = C.ui.text_inactive, bg = C.none },
62-
StatusInactive = { fg = C.ui.tabline, bg = C.ui.text_inactive }, -- TODO: find better inactive color
63-
StatusNormal = { fg = C.ui.tabline, bg = C.ui.blue },
64-
StatusInsert = { fg = C.ui.tabline, bg = C.ui.green },
65-
StatusVisual = { fg = C.ui.tabline, bg = C.ui.purple },
66-
StatusReplace = { fg = C.ui.tabline, bg = C.ui.red },
67-
StatusCommand = { fg = C.ui.tabline, bg = C.ui.yellow },
68-
StatusTerminal = { link = "StatusInsert" },
69-
WinBar = { fg = C.ui.winbar, bg = C.none },
70-
WinBarNC = {
71-
fg = C.ui.text_inactive,
72-
bg = (opts.transparent and opts.inactive and C.ui.inactive_base)
73-
or (opts.transparent and C.none)
74-
or (opts.inactive and C.ui.inactive_base)
75-
or C.ui.base,
76-
},
77-
TabLine = { fg = C.ui.text_inactive, bg = C.ui.tabline },
78-
TabLineSel = { fg = C.ui.text_active, bg = C.ui.base, bold = true },
79-
TabLineFill = { fg = C.none, bg = C.ui.tabline },
189+
190+
----------------
191+
--- Other
192+
----------------
80193
Terminal = { fg = C.ui.text, bg = C.ui.base },
81-
Visual = { fg = C.none, bg = C.ui.selection },
82-
VisualNOS = { fg = C.ui.selection, bg = C.none },
83-
VertSplit = { fg = C.ui.split, bg = opts.transparent and C.none or C.ui.base },
84-
WarningMsg = { fg = C.ui.yellow, bg = C.none },
85-
WildMenu = { fg = C.ui.base, bg = C.syntax.blue },
86-
EndOfBuffer = { fg = C.ui.base, bg = C.none },
87-
FloatTitle = { fg = C.ui.accent, bg = C.ui.tool, blend = 20, bold = true },
88-
FloatBorder = { fg = C.ui.border, bg = C.ui.tool, blend = 20 },
89-
-- Float = { fg = C.ui.border, bg = C.ui.base },
90-
MatchParen = { fg = C.none, bg = C.ui.highlight },
194+
Directory = { fg = C.ui.blue, bg = C.none },
195+
QuickFixLine = { fg = C.ui.base, bg = C.ui.yellow },
91196
}
92197
end
93198

lua/astrotheme/groups/plugins/lazy.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
local function callback()
22
return {
3-
LazyH1 = { fg = C.ui.base, bg = C.ui.accent, bold = true, italic = true }, -- home button
3+
LazyH1 = { fg = C.ui.base, bg = C.ui.accent, bold = true }, -- home button
44
LazyH2 = { fg = C.ui.accent, bold = true }, -- titles
55
LazyComment = { link = "Comment" },
6-
LazyNormal = { link = "NormalFloat" },
6+
LazyNormal = { link = "NormalPopup" },
77
LazyCommit = { fg = C.ui.text_inactive, bold = true }, -- commit ref
88
LazyCommitIssue = { fg = C.ui.yellow },
99
LazyCommitType = { fg = C.ui.accent, bold = true }, -- conventional commit type

lua/astrotheme/groups/plugins/mason.lua

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
local function callback()
22
return {
3-
MasonNormal = { link = "NormalFloat" },
4-
MasonHeader = { link = "FloatTitle" },
3+
MasonNormal = { link = "NormalPopup" },
4+
MasonHeader = { link = "PopupTitle" },
55
MasonHeaderSecondary = { bold = true, fg = C.ui.base, bg = C.ui.blue },
66

77
MasonHighlight = { fg = C.ui.blue },
88
MasonHighlightBlock = { bg = C.ui.blue, fg = C.ui.base },
9-
MasonHighlightBlockBold = { bg = C.ui.blue, fg = C.ui.base, bold = true },
9+
MasonHighlightBlockBold = { bg = C.ui.accent, fg = C.ui.base, bold = true },
1010

1111
MasonHighlightSecondary = { fg = C.ui.accent },
1212
MasonHighlightBlockSecondary = { bg = C.ui.accent, fg = C.ui.base },
@@ -15,7 +15,7 @@ local function callback()
1515
MasonLink = { link = "MasonHighlight" },
1616

1717
MasonMuted = { fg = C.ui.red },
18-
MasonMutedBlock = { bg = C.ui.text_inactive, fg = C.ui.text },
18+
MasonMutedBlock = { link = "CursorLine" },
1919
MasonMutedBlockBold = { bg = C.ui.blue, fg = C.ui.base, bold = true },
2020

2121
MasonError = { link = "ErrorMsg" },

lua/astrotheme/groups/plugins/neo-tree.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ local function callback(opts)
1919
},
2020
NeoTreeNormalNC = {
2121
fg = C.ui.text,
22-
bg = (opts.transparent and C.none) or C.ui.tool,
22+
bg = (opts.neotree and C.ui.tool) or (opts.transparent and C.none) or C.ui.base,
2323
},
2424
NeoTreeSymbolicLinkTarget = { fg = C.ui.cyan },
2525
NeoTreeTabActive = {

lua/astrotheme/groups/plugins/nvim-cmp.lua

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ local function callback()
3030
CmpItemKindUnit = { link = "@constant" },
3131
CmpItemKindValue = { link = "@constant" },
3232
CmpItemKindVariable = { link = "@variable" },
33-
CmpItemMenu = { bg = C.ui.popup },
3433
}
3534
end
3635
return callback

lua/astrotheme/groups/plugins/telescope.lua

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,23 @@ local function callback()
33
----------------
44
--- Title
55
----------------
6-
TelescopeTitle = { link = "FloatTitle" },
6+
TelescopeTitle = { link = "PopupTitle" },
77
TelescopeResultsTitle = { link = "TelescopeTitle" },
88
TelescopePromptTitle = { link = "TelescopeTitle" },
99
TelescopePreviewTitle = { link = "TelescopeTitle" },
1010

1111
----------------
1212
--- Normal
1313
----------------
14-
TelescopeNormal = { link = "NormalFloat" },
14+
TelescopeNormal = { link = "NormalPopup" },
1515
TelescopePreviewNormal = { link = "TelescopeNormal" },
1616
TelescopePromptNormal = { link = "TelescopeNormal" },
1717
TelescopeResultsNormal = { link = "TelescopeNormal" },
1818

1919
----------------
2020
--- Border
2121
----------------
22-
TelescopeBorder = { link = "FloatBorder" },
22+
TelescopeBorder = { link = "PopupBorder" },
2323
TelescopeResultsBorder = { link = "TelescopeBorder" },
2424
TelescopePromptBorder = { link = "TelescopeBorder" },
2525
TelescopePreviewBorder = { link = "TelescopeBorder" },
@@ -28,10 +28,10 @@ local function callback()
2828
--- Other
2929
----------------
3030
TelescopePromptPrefix = { fg = C.ui.accent },
31-
TelescopeSelectionCaret = { fg = C.ui.red },
31+
TelescopeSelectionCaret = { fg = C.ui.accent },
3232
TelescopeMatching = { fg = C.ui.text_match },
33-
-- TelescopeSelection = { bg = C.ui.current_line },
34-
TelescopeSelection = { fg = C.ui.base, bg = C.ui.accent, bold = true },
33+
TelescopeSelection = { bg = C.ui.current_line },
34+
-- TelescopeSelection = { fg = C.ui.base, bg = C.ui.accent, bold = true },
3535
TelescopeMultiSelection = { fg = C.syntax.blue },
3636
TelescopeMultiIcon = { fg = C.ui.blue },
3737
}

lua/astrotheme/lib/config.lua

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@ M.default = {
66
terminal_colors = true,
77
dev = false,
88
style = {
9-
inactive = true,
109
transparent = false,
11-
floating = true,
10+
inactive = true,
11+
float = true,
1212
popup = true,
1313
neotree = true,
14+
border = true,
15+
title_invert = false,
1416
italic_comments = true,
1517
simple_syntax_colors = false,
1618
},

0 commit comments

Comments
 (0)