Skip to content

Commit df281cc

Browse files
authored
feat: add options light_style (#231)
* feat: add options light_style * add default and docs for light_style
1 parent 4092905 commit df281cc

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ require("tokyonight").setup({
134134
-- your configuration comes here
135135
-- or leave it empty to use the default settings
136136
style = "storm", -- The theme comes in three styles, `storm`, `moon`, a darker variant `night` and `day`
137+
light_style = "day", -- The theme is used when the background is set to light
137138
transparent = false, -- Enable this to disable setting the background color
138139
terminal_colors = true, -- Configure the colors used when opening a `:terminal` in Neovim
139140
styles = {

lua/tokyonight/colors.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,8 @@ function M.setup(opts)
9999
opts = opts or {}
100100
local config = require("tokyonight.config")
101101

102-
local palette = M[config.options.style] or {}
102+
local style = config.is_day() and config.options.light_style or config.options.style
103+
local palette = M[style] or {}
103104
if type(palette) == "function" then
104105
palette = palette()
105106
end

lua/tokyonight/config.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ local M = {}
55
---@field on_highlights fun(highlights: Highlights, colors: ColorScheme)
66
local defaults = {
77
style = "storm", -- The theme comes in three styles, `storm`, a darker variant `night` and `day`
8+
light_style = "day", -- The theme is used when the background is set to light
89
transparent = false, -- Enable this to disable setting the background color
910
terminal_colors = true, -- Configure the colors used when opening a `:terminal` in Neovim
1011
styles = {

0 commit comments

Comments
 (0)