projekt0n / github-nvim-theme

GitHub's Neovim themes
MIT License
2.13k stars 104 forks source link

Assigning `bg_sidebar` to `bg_folded` doesn't make the folds{,column} transparent with transparency enabled #36

Closed wimstefan closed 3 years ago

wimstefan commented 3 years ago

I'm assigning different colors to folds as you suggested in issue #26 and it works so well :)

There is one thing though which I don't understand: Using

colors = {fg_folded = colors.fg, bg_folded = colors.bg_sidebar}

should give me a transparent fold{,column} background if transparent is set to true if I understand the configuration in colors.lua correctly? It is not the case in my configuration ... Here is the content of nvim_theme.lua

vim.o.background = 'dark'

if vim.o.background == 'dark' then
  local themeStyle = 'dimmed'
  local colors = require('github-theme.colors').setup({themeStyle = themeStyle})
  require('github-theme').setup({
    colors = {fg_folded = colors.fg, bg_folded = colors.bg_sidebar},
    sidebars = {'netrw', 'packer', 'qf', 'terminal'},
    themeStyle = themeStyle,
    transparent = true,
  })
else
  local themeStyle = 'light'
  local colors = require('github-theme.colors').setup({themeStyle = themeStyle})
  require('github-theme').setup({
    colors = {fg_folded = colors.fg, bg_folded = colors.bg_sidebar},
    sidebars = {'netrw', 'packer', 'qf', 'terminal'},
    themeStyle = themeStyle,
    transparent = true,
  })
end

I'm sure I'm doing something wrong but I couldn't find the solution yet ...

ful1e5 commented 3 years ago

I patched 6a95cca to the upstream. Now you are able to set transparent background with NONE value.

vim.o.background = "dark"
local transparent = true

if vim.o.background == "dark" then
  local themeStyle = "dimmed"
  local colors = require("github-theme.colors").setup({themeStyle = themeStyle})
  require("github-theme").setup({
    colors = {bg_folded = transparent and "NONE" or colors.bg_sidebar},
    sidebars = {"netrw", "packer", "qf", "terminal"},
    themeStyle = themeStyle,
    transparent = transparent
  })
else
  local themeStyle = "light"
  local colors = require("github-theme.colors").setup({themeStyle = themeStyle})
  require("github-theme").setup({
    colors = {bg_folded = transparent and "NONE" or colors.bg_sidebar},
    sidebars = {"netrw", "packer", "qf", "terminal"},
    themeStyle = themeStyle,
    transparent = transparent
  })
end
ful1e5 commented 3 years ago

Also, You don't have to override the fg_folded value to colors.fg because it's already assigned inside colors.lua.

https://github.com/projekt0n/github-nvim-theme/blob/03d4e5f5946b7790e0ef7314f25db670404c4add/lua/github-theme/colors.lua#L121-L123

wimstefan commented 3 years ago

Looking good. Very good :D I guess I simply was thinking the wrong way when I supposed that bg_sidebar is getting transparent as well just when I've set transparent = true ;)

Thank you so much for your support! 🙏