NvChad / base46

NvChad's base46 theme plugin with caching ( Total re-write )
Other
209 stars 204 forks source link

Custom theme issue #353

Closed nikola993 closed 1 month ago

nikola993 commented 1 month ago

When creating a new theme in base46 project under themes folder I came across an issue with SpecialChar, the issue is that is not pulling the right color. Form the source code it should be using base_16.base0F color but its not.

I tried adding the changes to polish_hl like this M.polish_hl = { SpecialChar = { fg = M.base_16.base0F }, } and like this M.polish_hl = { syntax = { SpecialChar = { fg = M.base_16.base0F }, } } but with no effect.

Can someone take a look and confim if I am doing everything correctly.

In the end I added in my chadrc file change hl_override = { SpecialChar = { fg = "#D7B596" }, } that did the job

This is the code from the file I added

-- this line for types, by hovering and autocompletion (lsp required)
-- will help you understanding properties, fields, and what highlightings the color used for
---@type Base46Table
local M = {}
-- UI
M.base_30 = {
  white = "#FFFFFB",
  darker_black = "#0D0B10",
  black = "#1E1B1F", --  nvim bg
  black2 = "#141617",
  lighter_black = "#2E2C2F",
  one_bg = "#161819",
  one_bg2 = "#1f2122",
  one_bg3 = "#27292a",
  grey = "#343637",
  grey_fg = "#3e4041",
  grey_fg2 = "#484a4b",
  light_grey = "#505253",
  red = "#CD6169",
  baby_pink = "#EE6A70",
  pink = "#e8646a",
  line = "#1b1d1e", -- for lines like vertsplit
  green = "#83B28A",
  vibrant_green = "#81c19b",
  nord_blue = "#5A84BC",
  blue = "#5EA7E3",
  yellow = "#E5BF79",
  sun = "#f6dc95",
  purple = "#c58cec",
  dark_purple = "#9E77BD",
  teal = "#51AEB9",
  orange = "#D2846D",
  cyan = "#67AFC1",
  statusline_bg = "#101213",
  lightbg = "#1d1f20",
  pmenu_bg = "#78B892",
  folder_bg = "#78B892",
}

M.base_16 = {
  base00 = M.base_30.darker_black,
  base01 = M.base_30.black,
  base02 = M.base_30.lighter_black,
  base03 = "#7F807E",
  base04 = "#D1D3CC",
  base05 = "#E1E4DC",
  base06 = "#F1F5EC",
  base07 = M.base_30.white,
  base08 = M.base_30.red,
  base09 = M.base_30.orange,
  base0A = M.base_30.yellow,
  base0B = M.base_30.green,
  base0C = M.base_30.teal,
  base0D = M.base_30.blue,
  base0E = M.base_30.dark_purple,
  base0F = "#D7B596",
}

M.polish_hl = {
  syntax = {
    SpecialChar = { fg = M.base_16.base0F },
  }
}

-- set the theme type whether is dark or light
M.type = "dark" -- "or light"

-- this will be later used for users to override your theme table from chadrc
M = require("base46").override_theme(M, "leaf_dark")

return M
siduck commented 1 month ago

your code is right

nikola993 commented 1 month ago

But the M.polish_hl is not doing anything I had to add hl_override = { SpecialChar = { fg = "#D7B596" }, } Inside of chadrc file to change the color of special characters, is that how it suppose to be?

siduck commented 1 month ago

image

your code works for me

nikola993 commented 1 month ago

When I delete code from chadrc this is what I get:

Screenshot 2024-10-15 at 12 07 16

That color for special character is not even included in the theme colors.

Did I added the theme in the correct place?

siduck commented 1 month ago

why are you adding theme there :/

please add themes in ~/.config/nvim/lua/themes only, dont touch plugin codebase

nikola993 commented 1 month ago

So I tried that as well but had the same result and I tried to move it to plugin to check, but it is the same in both cases.

siduck commented 1 month ago

i hope you are saving the files with nvim, or else nothing's gonna re-compile

siduck commented 1 month ago

did you change your nvim theme to leaf_dark?

nikola993 commented 1 month ago

Lol yeah, and yeah

Screenshot 2024-10-15 at 12 51 22

Every color from the theme is applied except for that one.

siduck commented 1 month ago

remove the hl_override, the polish_hl wont work

nikola993 commented 1 month ago

Scenario one:

Scenario two:

Scenario three:

Scenario four:

siduck commented 1 month ago

why complicate it !! just give your theme file, i will show a video recording from scratch that its working here.

nikola993 commented 1 month ago

I get it that it is working for you but it is not working for me any suggestions on why? I really don't have any fancy config for neovim couple of plugins and thats it, so I am not sure why it is not working for me correctly and it does for you.

Here is the file but I trust that its working on your side you don't have to make a video for it leaf_dark.txt

nikola993 commented 1 month ago

Just to let you know everything started working today without hl_override in chadrc not sure why. Sorry for the troubles

siduck commented 1 month ago

all good :joy: