Skip to content
1 change: 1 addition & 0 deletions doc/github-nvim-theme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,7 @@ Current list of modules are:
- neotree
- notify
- nvimtree
- snacks
- telescope
- treesitter
- treesitter_context
Expand Down
7 changes: 6 additions & 1 deletion lua/github-theme/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ local defaults = {
---@field neogit? boolean|GhTheme.Config.Module
---@field neotree? boolean|GhTheme.Config.Module
---@field notify? boolean|GhTheme.Config.Module
---@field snacks? boolean|GhTheme.Config.Module
---@field nvimtree? boolean|GhTheme.Config.Module
---@field telescope? boolean|GhTheme.Config.Module
---@field treesitter? boolean|GhTheme.Config.Module
Expand Down Expand Up @@ -147,6 +148,9 @@ local defaults = {

treesitter = util.is_nvim,
lsp_semantic_tokens = util.is_nvim,
snacks = {
enable = true,
},
},
}

Expand All @@ -155,9 +159,9 @@ M.module_names = {
'coc',
'coc_explorer',
'dapui',
'diffchar',
'dashboard',
'diagnostic',
'diffchar',
'fidget',
'fzf',
'gitgutter',
Expand All @@ -171,6 +175,7 @@ M.module_names = {
'neotree',
'notify',
'nvimtree',
'snacks',
'telescope',
'treesitter',
'treesitter_context',
Expand Down
2 changes: 1 addition & 1 deletion lua/github-theme/group/editor.lua
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function M.get(spec, config)
NormalNC = { fg = spec.fg1, bg = inactive and spec.bg0 or trans and 'NONE' or spec.bg1 }, -- normal text in non-current windows

NormalFloat = { fg = spec.fg1, bg = trans and 'NONE' or config.darken.floats and spec.bg0 or spec.bg1 }, -- Normal text in floating windows.
FloatBorder = { fg = c.border.default }, -- TODO
FloatBorder = { fg = spec.fg2, bg = trans and 'NONE' or spec.bg0 },
Pmenu = { fg = spec.fg1, bg = spec.bg0 }, -- Popup menu: normal item.
PmenuSel = { bg = spec.sel1 }, -- Popup menu: selected item.
PmenuSbar = { link = 'Pmenu' }, -- Popup menu: scrollbar.
Expand Down
108 changes: 108 additions & 0 deletions lua/github-theme/group/modules/snacks.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
-- https://github.com/folke/snacks.nvim/

local M = {}

---@param spec GhTheme.Spec
---@param config GhTheme.Config.Options
---@param opts GhTheme.Config.Module
function M.get(spec, config, opts)
local c = spec.palette

-- Handle configuration options
local indent_scope_color = (opts and opts.indent_scope_color) or 'text'
local float_transparent = config and config.options and config.options.transparent
local float_solid = config and config.options and not config.options.transparent

local hlgroups = {
SnacksNormal = { link = 'NormalFloat' },
SnacksWinBar = { link = 'Title' },
SnacksBackdrop = { link = 'FloatShadow' },
SnacksNormalNC = { link = 'NormalFloat' },
SnacksWinBarNC = { link = 'SnacksWinBar' },

SnacksNotifierInfo = { fg = c.blue.base },
SnacksNotifierIconInfo = { fg = c.blue.base },
SnacksNotifierTitleInfo = { fg = c.blue.base, style = 'italic' },
SnacksNotifierFooterInfo = { link = 'DiagnosticInfo' },
SnacksNotifierBorderInfo = { fg = c.blue.base },

SnacksNotifierWarn = { fg = c.yellow.base },
SnacksNotifierIconWarn = { fg = c.yellow.base },
SnacksNotifierTitleWarn = { fg = c.yellow.base, style = 'italic' },
SnacksNotifierBorderWarn = { fg = c.yellow.base },
SnacksNotifierFooterWarn = { link = 'DiagnosticWarn' },

SnacksNotifierDebug = { fg = c.orange },
SnacksNotifierIconDebug = { fg = c.orange },
SnacksNotifierTitleDebug = { fg = c.orange, style = 'italic' },
SnacksNotifierBorderDebug = { fg = c.orange },
SnacksNotifierFooterDebug = { link = 'DiagnosticHint' },

SnacksNotifierError = { fg = c.red.base },
SnacksNotifierIconError = { fg = c.red.base },
SnacksNotifierTitleError = { fg = c.red.base, style = 'italic' },
SnacksNotifierBorderError = { fg = c.red.base },
SnacksNotifierFooterError = { link = 'DiagnosticError' },

SnacksNotifierTrace = { fg = c.magenta.base },
SnacksNotifierIconTrace = { fg = c.magenta.base },
SnacksNotifierTitleTrace = { fg = c.magenta.base, style = 'italic' },
SnacksNotifierBorderTrace = { fg = c.magenta.base },
SnacksNotifierFooterTrace = { link = 'DiagnosticHint' },

SnacksDashboardNormal = { link = 'Normal' },
SnacksDashboardDesc = { fg = c.fg.default },
SnacksDashboardFile = { fg = c.blue.bright },
SnacksDashboardDir = { link = 'NonText' },
SnacksDashboardFooter = { fg = c.yellow.base, style = 'italic' },
SnacksDashboardHeader = { fg = c.magenta.bright },
SnacksDashboardIcon = { fg = c.orange, style = 'bold' },
SnacksDashboardKey = { fg = c.yellow.bright },
SnacksDashboardTerminal = { link = 'SnacksDashboardNormal' },
SnacksDashboardSpecial = { fg = c.fg.default },
SnacksDashboardTitle = { link = 'Title' },

SnacksIndent = { fg = spec.bg3 },
SnacksIndentScope = {
fg = indent_scope_color == 'text' and spec.fg1
or c[indent_scope_color] and c[indent_scope_color].base
or spec.fg1,
},

SnacksPickerSelected = {
fg = float_transparent and c.accent.fg or spec.fg1,
bg = float_transparent and 'NONE' or spec.bg3,
style = 'bold',
},
SnacksPickerMatch = { fg = c.yellow.bright },

SnacksPicker = { link = 'NormalFloat' },
SnacksPickerBorder = { link = 'FloatBorder' },
SnacksPickerInputBorder = { link = 'SnacksPickerBorder' },
SnacksPickerInput = { link = 'NormalFloat' },
SnacksPickerPrompt = { fg = c.accent.fg },
}

if float_solid then
hlgroups['SnacksPickerTitle'] = {
fg = spec.bg0,
bg = c.magenta.base,
}
hlgroups['SnacksPickerPreviewTitle'] = {
fg = spec.bg0,
bg = c.green.base,
}
hlgroups['SnacksPickerInputTitle'] = {
fg = spec.bg0,
bg = c.red.base,
}
hlgroups['SnacksPickerListTitle'] = {
fg = spec.bg0,
bg = c.blue.bright,
}
end

return hlgroups
end

return M
4 changes: 2 additions & 2 deletions lua/github-theme/palette/github_dark.lua
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,9 @@ local function generate_spec(pal)

spec.diag = {
error = pal.danger.fg,
warn = pal.attention.fg,
warn = pal.severe.fg,
info = pal.accent.fg,
hint = pal.fg.muted,
hint = pal.attention.fg,
}

spec.diag_bg = {
Expand Down
7 changes: 5 additions & 2 deletions lua/github-theme/util/lualine.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,11 @@ return function(style)
local tint = function(color)
return {
a = { bg = color, fg = s.bg1 },
b = { bg = blend(color, 0.2), fg = blend(color, 0.8) },
c = { bg = blend(color, 0.01), fg = blend(color, 0.60) },
b = { bg = blend(color, 0.1), fg = blend(color, 0.9) },
c = {
bg = config.transparent and 'NONE' or blend(color, 0.01),
fg = blend(color, 0.8),
},
}
end

Expand Down