Skip to content

Commit

Permalink
Feat: Improve borders, transparent background and default values (#97)
Browse files Browse the repository at this point in the history
* Feat: Make noice classic border cyan

* Ref: Decrease default visual blend

* Ref: Remove special border

* Ref: Better border colors and descriptions

* Fix: Correct float border bg

* Fix: Move colors declerations

* Ref: Improve transparent background

* Fix: Use border_fg for popup

* Ref: Change noice default to classic

* Docs: Add missing full-stop

* Fix: Add transparency check to border background

* Docs: Add note on small issues
  • Loading branch information
AlexvZyl authored Jan 3, 2024
1 parent be1bab5 commit f2ba174
Show file tree
Hide file tree
Showing 10 changed files with 55 additions and 48 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@

A Neovim colorscheme based on [Nord](https://www.nordtheme.com/), but Aurora > Frost. The idea behind this colorscheme is to use Nord, but add some darker colors and use Aurora more prominently than Nord themes usually do. This ends up creating a colorscheme that is soft on the eyes.

If there is anything that does not seem right, even if it is a very small highlight, please let me know with an issue or PR!

#### 💡 Looking for Maintainers

Currently looking for maintainers. If you are keen, head on over to [the discussion](https://github.com/AlexvZyl/nordic.nvim/discussions/96)
Currently looking for maintainers. If you are keen, head on over to [the discussion](https://github.com/AlexvZyl/nordic.nvim/discussions/96).

# 📷 Showcase

Expand Down Expand Up @@ -109,11 +111,11 @@ require 'nordic' .setup {
-- Avialable styles: 'dark', 'light'.
theme = 'dark',
-- Blending the cursorline bg with the buffer bg.
blend = 0.7,
blend = 0.85,
},
noice = {
-- Available styles: `classic`, `flat`.
style = 'flat',
style = 'classic',
},
telescope = {
-- Available styles: `classic`, `flat`.
Expand Down
52 changes: 30 additions & 22 deletions lua/nordic/colors/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,46 +27,54 @@ function C.extend_palette()
-- Some of the format is from @folke/tokyonight.nvim.

-- Backgrounds
C.bg = C.gray0
C.bg_dark = C.black0

C.bg_highlight = C.bg_dark
C.bg = (O.transparent_bg and C.none) or C.gray0
C.bg_dark = (O.transparent_bg and C.none) or C.black0
C.bg_highlight = U.blend(C.bg_dark, C.bg, O.cursorline.blend)
C.bg_visual = C.bg_highlight
C.bg_sidebar = C.bg
C.bg_float = C.black1
C.bg_popup = C.black1
C.bg_sidebar = (O.transparent_bg and C.none) or C.bg
C.bg_popup = (O.transparent_bg and C.none) or C.bg
C.bg_statusline = C.bg_dark
C.bg_selected = U.blend(C.gray2, C.black0, 0.4)
C.bg_fold = C.gray2

-- Borders
C.border_fg = (O.bright_border and C.white0) or C.black0
C.border_bg = (O.transparent_bg and C.none) or C.bg

-- Foregrounds
C.fg = C.white0
C.fg_bright = C.white1
C.fg_dark = C.white0
C.fg_sidebar = C.gray2
C.fg_fold = C.fg
C.fg_float = C.fg
C.fg_selected = C.fg_bright

-- Borders
C.border_fg = (O.bright_border and C.white0) or C.black0
C.border_bg = C.bg
C.border_float_fg = C.border_fg
C.border_float_bg = C.bg_popup
-- Popups
C.bg_popup = C.bg
C.fg_popup = C.fg
C.bg_popup_border = C.bg
C.fg_popup_border = C.border_fg

-- Floating windows
C.bg_float = C.black1
C.fg_float = C.fg
C.bg_float_border = C.bg_float
C.fg_float_border = C.border_fg

-- Diffs
C.diff = {}
C.diff.change0 = U.blend(C.blue1, C.bg, 0.05)
C.diff.change1 = U.blend(C.blue2, C.bg, diff_blend)
C.diff.add = U.blend(C.green.base, C.bg, diff_blend)
C.diff.delete = U.blend(C.red.base, C.bg, diff_blend)
C.diff = {
change0 = U.blend(C.blue1, C.bg, 0.05),
change1 = U.blend(C.blue2, C.bg, diff_blend),
add = U.blend(C.green.base, C.bg, diff_blend),
delete = U.blend(C.red.base, C.bg, diff_blend)
}

-- Git
C.git = {}
C.git.add = C.green.base
C.git.delete = C.red.base
C.git.change = C.blue1
C.git = {
add = C.green.base,
delete = C.red.base,
change = C.blue1
}

-- Diagnostics
C.error = C.red.bright
Expand Down
4 changes: 2 additions & 2 deletions lua/nordic/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ local defaults = {
-- Avialable styles: 'dark', 'light'.
theme = 'dark',
-- Blending the cursorline bg with the buffer bg.
blend = 0.7,
blend = 0.85,
},
noice = {
-- Available styles: `classic`, `flat`.
style = 'flat',
style = 'classic',
},
telescope = {
-- Available styles: `classic`, `flat`.
Expand Down
6 changes: 3 additions & 3 deletions lua/nordic/groups/integrations/gitsigns.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ local O = require('nordic.config').options

return {

GitSignsAdd = { fg = C.git.add, bg = O.transparent_bg and C.none or C.bg_sidebar },
GitSignsChange = { fg = C.git.change, bg = O.transparent_bg and C.none or C.bg_sidebar },
GitSignsDelete = { fg = C.git.delete, bg = O.transparent_bg and C.none or C.bg_sidebar },
GitSignsAdd = { fg = C.git.add, bg = C.bg_sidebar },
GitSignsChange = { fg = C.git.change, bg = C.bg_sidebar },
GitSignsDelete = { fg = C.git.delete, bg = C.bg_sidebar },

GitSignsAddPreview = { link = 'GitSignsAdd' },
GitSignsDeletePreview = { link = 'GitSignsDelete' },
Expand Down
2 changes: 1 addition & 1 deletion lua/nordic/groups/integrations/lspsaga.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
local C = require 'nordic.colors'

return {
SagaBorder = { bg = C.black2, fg = C.border_float_fg },
SagaBorder = { bg = C.black2, fg = C.fg_float_border },
SagaNormal = { bg = C.black2 },

HoverBorder = { link = 'FloatBorder' },
Expand Down
4 changes: 2 additions & 2 deletions lua/nordic/groups/integrations/noice.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ local groups = {
NoiceCmdlineIcon = { bg = C.bg_float, fg = C.yellow.base },
NoiceCmdlineIconSearch = { bg = C.bg_dark, fg = C.yellow.base },

NoicePopupBorder = { fg = C.border_float_fg, bg = C.border_float_bg },
NoicePopupBorder = { fg = C.black0, bg = C.black1 },
NoiceCmdlinePopupBorder = { link = 'NoicePopupBorder' },
NoiceCmdlinePopupBorderSearch = { link = 'NoicePopupBorder' },
NoiceCmdlinePopup = { bg = C.black1 },
Expand All @@ -23,7 +23,7 @@ local groups = {
if O.noice.style == 'classic' then
groups.NoiceCmdline = { bg = C.bg, fg = C.cyan.base }
groups.NoiceCmdlinePopup = { bg = C.bg }
groups.NoicePopupBorder = { bg = C.bg, fg = C.border_float_fg }
groups.NoicePopupBorder = { bg = C.bg, fg = C.cyan.base }
groups.NoiceCmdlineIcon = { bg = C.bg, fg = C.yellow.bright }
end

Expand Down
2 changes: 0 additions & 2 deletions lua/nordic/groups/integrations/nvim-cmp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,4 @@ return {

CmpItemKindTabNine = { fg = C.red.base },
CmpItemKindCopilot = { fg = C.red.base },

SpecialCmpBorder = { fg = C.bg, bg = C.bg_float },
}
7 changes: 3 additions & 4 deletions lua/nordic/groups/integrations/nvim-tree.lua
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
local C = require 'nordic.colors'
local O = require('nordic.config').options

return {

NvimTreeNormal = { fg = C.fg, bg = O.transparent_bg and C.none or C.gray0 },
NvimTreeNormalNC = { fg = C.fg, bg = O.transparent_bg and C.none or C.gray0 },
NvimTreeNormal = { fg = C.fg, bg = C.bg },
NvimTreeNormalNC = { fg = C.fg, bg = C.bg },

NvimTreeFolderName = { fg = C.blue1 },
NvimTreeOpenedFolderName = { link = 'NvimTreeFolderName' },
Expand All @@ -20,7 +19,7 @@ return {
NvimTreeGitStaged = { fg = C.gray4 },
NvimTreeIndentMarker = { fg = C.gray4 },

NvimTreeWinSeparator = { fg = C.bg_dark, bg = O.transparent_bg and C.none or C.gray0 },
NvimTreeWinSeparator = { fg = C.bg_dark, bg = C.bg },

NvimTreeCursorLine = { bg = C.gray1 },
NvimTreeCursor = { bg = C.none, fg = C.none },
Expand Down
8 changes: 4 additions & 4 deletions lua/nordic/groups/integrations/telescope.lua
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ if O.telescope.style == 'flat' then
groups.TelescopePromptTitle = { bg = C.orange.base, fg = C.black0, bold = true }
groups.TelescopeTitle = { bg = C.orange.base, fg = C.black0, bold = true }

groups.TelescopeBorder = { fg = C.border_float_fg, bg = C.black0 }
groups.TelescopePromptBorder = { bg = C.black2, fg = C.border_float_fg }
groups.TelescopeResultsBorder = { bg = C.black1, fg = C.border_float_fg }
groups.TelescopePreviewBorder = { bg = C.black1, fg = C.border_float_fg }
groups.TelescopeBorder = { fg = C.black0, bg = C.black0 }
groups.TelescopePromptBorder = { bg = C.black2, fg = C.black0 }
groups.TelescopeResultsBorder = { bg = C.black1, fg = C.black0 }
groups.TelescopePreviewBorder = { bg = C.black1, fg = C.black0 }

groups.TelescopeMultiIcon = { fg = C.yellow.bright, bg = C.black1, bold = true }
groups.TelescopeMultiSelection = { bg = C.black1 }
Expand Down
10 changes: 5 additions & 5 deletions lua/nordic/groups/native/editor.lua
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ local groups = {
Folded = { fg = C.fg_fold, bg = C.bg_fold }, -- line used for closed folds
FoldColumn = { bg = C.bg_fold, fg = C.fg_fold }, -- 'foldcolumn'

SignColumn = { bg = O.transparent_bg and C.none or C.bg_sidebar, fg = C.fg_sidebar }, -- column where |signs| are displayed
SignColumn = { bg = C.bg_sidebar, fg = C.fg_sidebar }, -- column where |signs| are displayed
SignColumnSB = { bg = C.bg_sidebar, fg = C.fg_sidebar }, -- column where |signs| are displayed

Substitute = { bg = C.red.base, fg = C.bg_dark }, -- |:substitute| replacement text highlighting
Expand All @@ -46,12 +46,12 @@ local groups = {
MoreMsg = { fg = C.blue1 }, -- |more-prompt|
NonText = { fg = C.gray4 }, -- '@' at the end of the window, characters from 'showbreak' and other characters that do not really exist in the text (e.g., ">" displayed when a double-wide character doesn't fit at the end of the line). See also |hl-EndOfBuffer|.

Normal = { fg = C.fg, bg = O.transparent_bg and C.none or C.bg }, -- normal text
NormalNC = { fg = C.fg, bg = O.transparent_bg and C.none or C.bg }, -- normal text in non-current windows
NormalSB = { fg = C.fg_sidebar, bg = O.transparent_bg and C.none or C.bg_sidebar }, -- normal text in sidebar
Normal = { fg = C.fg, bg = C.bg }, -- normal text
NormalNC = { fg = C.fg, bg = C.bg }, -- normal text in non-current windows
NormalSB = { fg = C.fg_sidebar, bg = C.bg_sidebar }, -- normal text in sidebar

NormalFloat = { fg = C.fg_float, bg = C.bg_float }, -- Normal text in floating windows.
FloatBorder = { fg = C.border_float_fg, bg = C.border_float_bg },
FloatBorder = { fg = C.fg_float_border, bg = C.bg_float_border },
FloatTitle = { fg = C.yellow.base },

Pmenu = { bg = C.bg_popup }, -- Popup menu: normal item.
Expand Down

0 comments on commit f2ba174

Please sign in to comment.