Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot set light theme via setup(opts) #173

Open
juangiordana opened this issue Jun 23, 2023 · 2 comments
Open

Cannot set light theme via setup(opts) #173

juangiordana opened this issue Jun 23, 2023 · 2 comments

Comments

@juangiordana
Copy link

I've been playing around with the Lazy plugin manager and onedark, basically setting some custom options for loading the color scheme.

For this I've been trying to use the light theme to have a strong visual notice if the modifications I was doing where loading.

It turns out that if I use any other of the provided themes the changes were reflected, but when using the light theme the color scheme was not applied, instead it loaded the dark theme:

elseif vim.g.onedark_config.style == 'light' then

I only have a couple of weeks using Neovim so far so sending a PR would take me a while atm, but I think the referenced line could be the source of my problem and I thought about mentioning this here so you can take a look.

Cheers!

@rudimusmaximus
Copy link

Had the same issue, here's what I did. I can see all of the themes.
In setup examples, the readme shows you can define a toggle, your default style, and the set of themes it switches between if one of the available. From my lua,

        style = 'deep',
        -- toggle theme style --- nil to disable
        toggle_style_key = '<leader>ts', -- nil to disable or set it to a string, for example "<leader>ts"
        toggle_style_list = { 'darker', 'deep', 'warmer', 'light' },
        -- toggle_style_list = { 'dark', 'darker', 'cool', 'deep', 'warm', 'warmer', 'light' }, -- List of styles to toggle between

@mesmere
Copy link

mesmere commented Feb 8, 2024

It looks like onedark actually checks vim.opt.background in order to decide whether to set the light theme. This workaround seems fine until it's fixed (lazy.vim style):

return {{
  "navarasu/onedark.nvim",
  opts = {
    style = "light",
  },
  config = function(_, opts)
    vim.opt.background = "light"
    require("onedark").setup(opts)
  end
}}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants