Merge pull request #950 from lackac/themes/solarized
Some checks are pending
Set up binary cache / cachix (default) (push) Waiting to run
Set up binary cache / cachix (maximal) (push) Waiting to run
Set up binary cache / cachix (nix) (push) Waiting to run
Treewide Checks / Validate flake (push) Waiting to run
Treewide Checks / Check formatting (push) Waiting to run
Treewide Checks / Check source tree for typos (push) Waiting to run
Treewide Checks / Validate documentation builds (push) Waiting to run
Treewide Checks / Validate hyperlinks in documentation sources (push) Waiting to run
Treewide Checks / Validate Editorconfig conformance (push) Waiting to run
Build and deploy documentation / Check latest commit (push) Waiting to run
Build and deploy documentation / publish (push) Blocked by required conditions

themes/solarized: init
This commit is contained in:
raf 2025-06-13 22:06:14 +03:00 committed by GitHub
commit b3e3bd9be9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 75 additions and 2 deletions

View file

@ -426,4 +426,10 @@
[theutz](https://github.com/theutz):
- Added "auto" flavour for catppuccin theme
- Added "auto" flavour for catppuccin theme
[lackac](https://github.com/lackac):
[solarized.nvim]: https://github.com/maxmx03/solarized.nvim
- Add [solarized.nvim] theme with support for multiple variants

View file

@ -2,7 +2,9 @@
config,
lib,
}: let
inherit (lib.strings) optionalString;
inherit (lib.strings) optionalString splitString;
inherit (lib.attrsets) mapCartesianProduct;
inherit (lib.lists) intersectLists;
inherit (lib.trivial) boolToString warnIf;
inherit (lib.nvim.lua) toLuaObject;
in {
@ -217,6 +219,55 @@ in {
'';
styles = ["dark" "light" "dark_dimmed" "dark_default" "light_default" "dark_high_contrast" "light_high_contrast" "dark_colorblind" "light_colorblind" "dark_tritanopia" "light_tritanopia"];
};
solarized = let
backgrounds = ["light" "dark"];
palettes = ["solarized" "selenized"];
variants = ["spring" "summer" "autumn" "winter"];
in {
setup = {
style ? "", # use plugin defaults
transparent ? false,
...
}: let
parts = splitString "-" style;
detect = list: let
intersection = intersectLists parts list;
in
if intersection == []
then null
else builtins.head intersection;
background = detect backgrounds;
palette = detect palettes;
variant = detect variants;
in ''
-- Solarized theme
require('solarized').setup {
transparent = {
enabled = ${boolToString transparent},
},
${optionalString (!isNull palette) ''palette = "${palette}",''}
${optionalString (!isNull variant) ''variant = "${variant}",''}
}
${optionalString (!isNull background) ''vim.opt.background = "${background}"''}
vim.cmd.colorscheme "solarized"
'';
styles = let
joinWithDashes = parts: lib.concatStringsSep "-" (lib.filter (s: s != "") parts);
combinations = mapCartesianProduct ({
bg,
pal,
var,
}:
joinWithDashes [bg pal var]) {
bg = [""] ++ backgrounds;
pal = [""] ++ palettes;
var = [""] ++ variants;
};
in
lib.filter (s: s != "") combinations;
};
solarized-osaka = {
setup = {transparent ? false, ...}: ''
require("solarized-osaka").setup({

View file

@ -2261,6 +2261,22 @@
"url": "https://api.github.com/repos/folke/snacks.nvim/tarball/v2.22.0",
"hash": "1hbm4fnw51qdp0nz83fcxbvnxjq2k57a37w6dp0wz6wkcx7cwxw9"
},
"solarized": {
"type": "GitRelease",
"repository": {
"type": "GitHub",
"owner": "maxmx03",
"repo": "solarized.nvim"
},
"pre_releases": false,
"version_upper_bound": null,
"release_prefix": null,
"submodules": false,
"version": "v3.6.0",
"revision": "c0dfe1cbfabd93b546baf5f1408f5df7e02e2050",
"url": "https://api.github.com/repos/maxmx03/solarized.nvim/tarball/v3.6.0",
"hash": "1fz1wc569w26aanmj3hhsc17xrx29g6bfsjsbgssa7jq76aavp3w"
},
"solarized-osaka": {
"type": "Git",
"repository": {