Skip to content

Commit

Permalink
feat(themes/crbn): add NULL dark theme variant and refine UI colors
Browse files Browse the repository at this point in the history
- feat: introduce new `crbn-null` dark theme with cool gray undertones
- refactor: rename `carbon-super` to `crbn-supr` for consistency
- style(ui): update cursor line highlighting to use `bg.active`
- feat(plugins): add highlight groups for `snacks.nvim`
- docs: update theme key registry with new `crbn-null` entry
- style(crbn/supr): promote theme status from `beta` to `release`
  • Loading branch information
nikbrunner committed Feb 10, 2025
1 parent 47d84e4 commit 3d9104f
Show file tree
Hide file tree
Showing 10 changed files with 261 additions and 7 deletions.
3 changes: 3 additions & 0 deletions colors/black-atom-crbn-null.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
local theme = require("black-atom.themes.crbn.black-atom-crbn-null")

require("black-atom").load(theme)
File renamed without changes.
21 changes: 21 additions & 0 deletions lua/black-atom/highlights/plugins/snacks_nvim.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---@doc https://github.com/username/plugin-name
---@type BlackAtom.HighlightsSpec
return {
enabled = true,
map = function(colors, config)
-- There are also helper functions for common background colors, which are dependent on the config
local bg_dark = require("black-atom.lib").bg.dark(config, colors)

local p = colors.palette -- These are semantic color tokens for the palette
local ui = colors.ui -- These are semantic color tokens for the UI
local s = colors.syntax -- These are semantic color tokens for the syntax

-- IMPORTANT: Ensure the highlight groups are returned in the correct structure so that the script to automatically generate the README.md file can work correctly
---@type BlackAtom.Highlights
return {
-- SnacksPickerCursorLine = { fg = ui.fg.invert, bg = p.blue },
SnacksPickerCursorLine = { bg = ui.bg.active },
SnacksPickerListCursorLine = { link = "SnacksPickerCursorLine" },
}
end,
}
4 changes: 2 additions & 2 deletions lua/black-atom/highlights/ui.lua
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ return {
TermCursor = { link = "Cursor" },
TermCursorNC = { link = "Cursor" },

CursorLine = { bg = ui.bg.primary.dark },
CursorColumn = { bg = ui.bg.primary.dark },
CursorLine = { bg = ui.bg.active },
CursorColumn = { bg = ui.bg.active },

-- Search
Search = { bg = ui.bg.match.passive },
Expand Down
76 changes: 76 additions & 0 deletions lua/black-atom/themes/crbn/black-atom-crbn-null.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
local M = {}

---@type BlackAtom.Theme.Meta
M.meta = {
key = "black-atom-crbn-null",
label = "Black Atom - CRBN [NULL]",
collection = {
key = "crbn",
label = "CRBN",
},
appearance = "dark",
icon = " 󰛸 ",
status = "release",
}

---@type BlackAtom.Theme.Primaries
M.primaries = {
-- Lows
"#141a20",
"#212c36",
"#384e62",

-- Mids
"#566575",
"#6c8093",
"#819cb1",

-- Highs
"#d3d9df",
"#e0e6ec",
"#ebf2f8",
}

---@type BlackAtom.Theme.Palette
M.palette = {
black = M.primaries[2],
gray = M.primaries[4],

dark_red = "#f33e25",
red = "#ff624d",

dark_green = "#6ad147",
green = "#8bdb70",

dark_yellow = "#e9693d",
yellow = "#ff8357",

dark_blue = "#4481ef",
blue = "#679cff",

dark_magenta = M.primaries[5],
magenta = M.primaries[6],

dark_cyan = M.primaries[3],
cyan = M.primaries[2],

dark_gray = M.primaries[7],
white = M.primaries[9],
}

---@type BlackAtom.Theme.Syntax
M.syntax = require("black-atom.themes.crbn.syntax_dark")(M.primaries, M.palette)

---@typ BlackAtom.Theme.UI
M.ui = require("black-atom.themes.crbn.ui_dark")(M.primaries, M.palette)

---@type BlackAtom.Theme.Colors
M.colors = {
none = "NONE",
primaries = M.primaries,
palette = M.palette,
ui = M.ui,
syntax = M.syntax,
}

return M
2 changes: 1 addition & 1 deletion lua/black-atom/themes/crbn/black-atom-crbn-supr.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ M.meta = {
},
appearance = "light",
icon = " 󰛸 ",
status = "beta",
status = "release",
}

---@type BlackAtom.Theme.Primaries
Expand Down
103 changes: 103 additions & 0 deletions lua/black-atom/themes/crbn/syntax_dark.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
---@param primaries BlackAtom.Theme.Primaries
---@param palette BlackAtom.Theme.Palette
---@return BlackAtom.Theme.Syntax
return function(primaries, palette)
return {
variable = {
default = primaries[6],
builtin = primaries[6],
member = primaries[5],
parameter = palette.dark_yellow,
},
property = {
default = primaries[7],
},
string = {
default = primaries[5],
doc = primaries[4],
regexp = primaries[9],
escape = primaries[9],
},
constant = {
default = primaries[6],
builtin = primaries[7],
},
module = {
default = palette.yellow,
},
boolean = {
default = palette.gray,
},
number = {
default = primaries[6],
},
type = {
default = primaries[9],
builtin = primaries[7],
},
attribute = {
default = palette.dark_yellow,
builtin = palette.dark_yellow,
},
func = {
default = palette.yellow,
builtin = palette.dark_yellow,
method = palette.yellow,
},
constructor = {
default = palette.yellow,
},
keyword = {
default = primaries[8],
import = primaries[6],
export = primaries[6],
},
operator = {
default = palette.white,
},
punctuation = {
default = palette.white,
delimiter = palette.white,
bracket = palette.white,
special = palette.white,
},
comment = {
default = palette.gray,
doc = primaries[6],
todo = palette.green,
error = palette.red,
warn = palette.yellow,
info = palette.blue,
hint = palette.dark_yellow,
},
markup = {
heading = {
h1 = palette.yellow,
h2 = palette.yellow,
h3 = palette.yellow,
h4 = palette.gray,
h5 = palette.gray,
h6 = palette.gray,
},
list = {
default = palette.gray,
checked = palette.green,
unchecked = palette.gray,
},
quote = palette.green,
math = palette.dark_green,
link = palette.green,
code = {
fg = primaries[7],
bg = primaries[4],
},
},
tag = {
default = palette.yellow,
builtin = palette.dark_yellow,
custom = palette.yellow,
attribute = primaries[4],
delimiter = primaries[5],
},
}
end
50 changes: 50 additions & 0 deletions lua/black-atom/themes/crbn/ui_dark.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---@param primaries BlackAtom.Theme.Primaries
---@param palette BlackAtom.Theme.Palette
---@return BlackAtom.Theme.UI
return function(primaries, palette)
---@type BlackAtom.Theme.UI
return {
bg = {
primary = {
main = primaries[1], -- primary
dark = primaries[2], -- secondary
light = primaries[3], -- tertiary
},
active = primaries[3],
match = {
active = palette.magenta,
passive = primaries[2],
},
diff = {
add = palette.green,
delete = palette.red,
change = palette.blue,
text = palette.dark_blue,
},
},
fg = {
primary = {
main = primaries[9],
dark = primaries[8],
light = primaries[7],
},
active = palette.yellow,
invert = primaries[2],
neutral = primaries[6],
diff = {
add = palette.green,
delete = palette.red,
change = palette.blue,
text = palette.dark_blue,
},
},
feedback = {
error = palette.red,
warn = palette.yellow,
info = palette.blue,
hint = palette.dark_yellow,
todo = palette.yellow,
success = palette.green,
},
}
end
8 changes: 4 additions & 4 deletions lua/black-atom/themes/crbn/ui_light.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ return function(primaries, palette)
return {
bg = {
primary = {
dark = primaries[8],
main = primaries[9],
light = primaries[7],
dark = primaries[8], -- secondary
main = primaries[9], -- primary
light = primaries[7], -- tertiary
},
active = primaries[6],
active = primaries[7],
match = {
active = palette.magenta,
passive = primaries[8],
Expand Down
1 change: 1 addition & 0 deletions lua/black-atom/types.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
---| "black-atom-jpn-koyo-hiru"
---| "black-atom-jpn-tsuki-yoru"
---| "black-atom-mono-one-dark"
---| "black-atom-crbn-null"
---| "black-atom-crbn-supr"
---| "terra-spring-day"
---| "terra-spring-night"
Expand Down

0 comments on commit 3d9104f

Please sign in to comment.