Skip to content

Commit

Permalink
feat: set background inside config module projekt0n#60 projekt0n#116
Browse files Browse the repository at this point in the history
  • Loading branch information
ful1e5 committed Oct 25, 2021
1 parent e97e960 commit 3aab1cb
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- `pmenu.select` color removed
- pmenu select background color with dynamic blue color
- breaking change: terminal colors are renamed
- feat: set `vim.o.background` with config module (re-patch #60 #116)

### Fixes

Expand Down
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,6 @@ require('github-theme').setup()

## Configuration

> Note: set `vim.o.background = "light"` before loading light github colorschemes.
| Option | Default | Description |
| ------------------------ | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| theme_style | `dark` | Set theme variant (options: `dark`/`dark_default`/`dimmed`/`light`/`light_default`) |
Expand All @@ -101,13 +99,13 @@ require('github-theme').setup()

```vim
" Example config in VimScript
" configuration needs to be set BEFORE loading the color scheme with `colorscheme` command
" NOTE: Configuration needs to be set BEFORE loading the color scheme with `colorscheme` command
let g:github_function_style = "italic"
let g:github_sidebars = ["qf", "vista_kind", "terminal", "packer"]
" Change the "hint" color to the "orange" color, and make the "error" color bright red
let g:github_colors = {
\ 'hint': 'orange',
\ 'hint: 'orange',
\ 'error': '#ff0000'
\ }
Expand Down
5 changes: 5 additions & 0 deletions lua/github-theme/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ config = {
transform_colors = false
}

-- setting light background
local light_background = {["light"] = true, ["light_default"] = true}

if light_background[config.theme_style] then vim.o.background = "light" end

---@param user_config Config
local function apply_configuration(user_config)
for key, value in pairs(user_config) do
Expand Down

0 comments on commit 3aab1cb

Please sign in to comment.