folke / tokyonight.nvim

🏙 A clean, dark Neovim theme written in Lua, with support for lsp, treesitter and lots of plugins. Includes additional themes for Kitty, Alacritty, iTerm and Fish.
Apache License 2.0
6.42k stars 433 forks source link

bug: Background transparency not applying to lualine #516

Closed j0of closed 6 months ago

j0of commented 6 months ago

Did you check docs and existing issues?

Neovim version (nvim -v)

0.9.5

Operating system/version

WSL 2

Describe the bug

In the tokyonight setup function, I have transparent set to true. This makes everything transparent except the middle bit of the lualine. image

Steps To Reproduce

  1. Install tokyonight + lualine plugins
  2. Add the following to config:
    require("tokyonight").setup({
    style = "storm",
    transparent = true,
    styles = {
    sidebars = "transparent",
    floats = "transparent",
    },
    })

Expected Behavior

The background transparency should have also been applied to lualine

Repro

-- DO NOT change the paths and don't remove the colorscheme
local root = vim.fn.fnamemodify("./.repro", ":p")

-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
  vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end

-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
  vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath, })
end
vim.opt.runtimepath:prepend(lazypath)

-- install plugins
local plugins = {
  "folke/tokyonight.nvim",
  -- add any other plugins here
  "nvim-lualine/lualine.nvim",
  "nvim-tree/nvim-web-devicons"
}

require("tokyonight").setup({
  style = "storm",
  transparent = true,
  styles = {
    sidebars = "transparent",
    floats = "transparent",
  },
})

require("lualine").setup({
  options = {
    theme = "tokyonight"
  }
})

require("lazy").setup(plugins, {
  root = root .. "/plugins",
})

vim.cmd.colorscheme("tokyonight")
-- add anything else here
j0of commented 6 months ago

Fixed by adding this to setup:

      on_colors = function(colors)
        colors.bg_statusline = colors.none -- To check if its working try something like "#ff00ff" instead of colors.none
      end,
kamransoomro84 commented 5 months ago

I kind of have the same problem. I'm trying to set a custom colour for bold text. This is what I have in my lazy.setup() function now but it doesn't work.

{
    "folke/tokyonight.nvim",
    lazy = false,
    opts = {
      on_colors = function(colors)
        colors["@markup.strong"] = colors.orange
      end
    },
    config = function()
      vim.cmd.colorscheme 'tokyonight-night'
    end,
  },

Do I need to move this out of lazy.setup() for it to work?