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.25k stars 414 forks source link

docs(readme): recipe to modify a style #601

Open jdujava opened 2 months ago

jdujava commented 2 months ago

Description

Document the ability to modify the color palette of a style.

Related Issue(s)

See #595.

github-actions[bot] commented 1 month ago

This PR is stale because it has been open 30 days with no activity.

jdujava commented 1 month ago

I think this is still relevant :).

MayRedwood commented 1 month ago

This is not very clear - where, exactly, are we supposed to put that code?

jdujava commented 1 month ago

Neighboring examples also don't provide exact instructions on where to put the code. I personally put it in the config function in lazy spec for tokyonight like

config = function(_, opts)                                                       
    local styles = require('tokyonight.colors').styles                           

    -- change the colors for your new palette here                                          
    ---@type Palette                                                             
    local modified_colors = {                                                    
        bg_darker    = '#1a1a1a',                                                
        ...
    }                                                                            
    -- save as `custom` style (by extending the `storm` style)                                            
    styles.custom = vim.tbl_extend('force', styles.storm --[[@as Palette]], modified_colors)

    require('tokyonight').load(opts) -- load custom style (be sure to have opts.style = 'custom')

end,                                                                             

If it would be desirable, I have no problem including it in the recipe.

github-actions[bot] commented 1 day ago

This PR is stale because it has been open 30 days with no activity.

jdujava commented 1 day ago

Is there a reason for not merging this yet?