feat: add options light_style (#231)

* feat: add options light_style

* add default and docs for light_style
This commit is contained in:
Loong Wang 2022-10-03 00:25:44 +08:00 committed by GitHub
parent 4092905fc5
commit df281cc0f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 1 deletions

View File

@ -134,6 +134,7 @@ require("tokyonight").setup({
-- your configuration comes here -- your configuration comes here
-- or leave it empty to use the default settings -- or leave it empty to use the default settings
style = "storm", -- The theme comes in three styles, `storm`, `moon`, a darker variant `night` and `day` style = "storm", -- The theme comes in three styles, `storm`, `moon`, a darker variant `night` and `day`
light_style = "day", -- The theme is used when the background is set to light
transparent = false, -- Enable this to disable setting the background color transparent = false, -- Enable this to disable setting the background color
terminal_colors = true, -- Configure the colors used when opening a `:terminal` in Neovim terminal_colors = true, -- Configure the colors used when opening a `:terminal` in Neovim
styles = { styles = {

View File

@ -99,7 +99,8 @@ function M.setup(opts)
opts = opts or {} opts = opts or {}
local config = require("tokyonight.config") local config = require("tokyonight.config")
local palette = M[config.options.style] or {} local style = config.is_day() and config.options.light_style or config.options.style
local palette = M[style] or {}
if type(palette) == "function" then if type(palette) == "function" then
palette = palette() palette = palette()
end end

View File

@ -5,6 +5,7 @@ local M = {}
---@field on_highlights fun(highlights: Highlights, colors: ColorScheme) ---@field on_highlights fun(highlights: Highlights, colors: ColorScheme)
local defaults = { local defaults = {
style = "storm", -- The theme comes in three styles, `storm`, a darker variant `night` and `day` style = "storm", -- The theme comes in three styles, `storm`, a darker variant `night` and `day`
light_style = "day", -- The theme is used when the background is set to light
transparent = false, -- Enable this to disable setting the background color transparent = false, -- Enable this to disable setting the background color
terminal_colors = true, -- Configure the colors used when opening a `:terminal` in Neovim terminal_colors = true, -- Configure the colors used when opening a `:terminal` in Neovim
styles = { styles = {