feat: better theming

This commit is contained in:
2024-04-29 21:09:34 +02:00
parent 43ca38910c
commit 1ca4663d76
4 changed files with 190 additions and 61 deletions

View File

@@ -9,7 +9,7 @@
:root {
--transparencycolor: {{colors.surface.default.red}}, {{colors.surface.default.green}}, {{colors.surface.default.blue}};
--transparencyalpha: 0.8;
--transparencyalpha: {{custom.transparency}};
--messagetransparency: 0;
--guildchanneltransparency: 0;
--chatinputtransparency: 0;
@@ -30,7 +30,7 @@
--popoutsize: var(--backgroundsize);
--popoutblur: var(--backgroundblur);
--backdrop: rgba({{colors.surface.default.red}}, {{colors.surface.default.green}}, {{colors.surface.default.blue}}, 0.8);
--backdrop: rgba({{colors.surface.default.red}}, {{colors.surface.default.green}}, {{colors.surface.default.blue}}, {{custom.transparency}});
--backdropposition: center;
--backdropsize: cover: --backdropblur: 0;

View File

@@ -2,23 +2,23 @@
@define-color accent_bg_color {{colors.primary_container.default.hex}};
@define-color accent_fg_color {{colors.on_primary.default.hex}};
@define-color destructive_color {{colors.error.default.hex}};
@define-color destructive_bg_color {{colors.error_container.default.hex}};
@define-color destructive_fg_color {{colors.on_error.default.hex}};
@define-color destructive_color {{colors.danger.default.hex}};
@define-color destructive_bg_color {{colors.danger_container.default.hex}};
@define-color destructive_fg_color {{colors.on_danger.default.hex}};
@define-color success_color {{colors.ok.default.hex}};
@define-color success_bg_color {{colors.ok_container.default.hex}};
@define-color success_fg_color {{colors.on_ok.default.hex}};
@define-color success_color {{colors.success.default.hex}};
@define-color success_bg_color {{colors.success_container.default.hex}};
@define-color success_fg_color {{colors.on_success.default.hex}};
@define-color warning_color {{colors.warn.default.hex}};
@define-color warning_bg_color {{colors.warn_container.default.hex}};
@define-color warning_fg_color {{colors.on_warn.default.hex}};
@define-color warning_color {{colors.warning.default.hex}};
@define-color warning_bg_color {{colors.warning_container.default.hex}};
@define-color warning_fg_color {{colors.on_warning.default.hex}};
@define-color error_color {{colors.error.default.hex}};
@define-color error_bg_color {{colors.error_container.default.hex}};
@define-color error_fg_color {{colors.on_error.default.hex}};
@define-color window_bg_color alpha({{colors.surface.default.hex}}, 0.8);
@define-color window_bg_color alpha({{colors.surface.default.hex}}, {{custom.transparency}});
@define-color window_fg_color {{colors.on_surface.default.hex}};
@define-color view_bg_color @window_bg_color;

View File

@@ -52,6 +52,122 @@ in
default = 16;
description = "The blur amount of windows";
};
semantic = {
blend = lib.mkOption {
type = lib.types.bool;
default = false;
description = "Blend the colors";
};
danger = lib.mkOption {
type = lib.types.str;
default = "#ff0000";
description = "The color of danger";
};
warning = lib.mkOption {
type = lib.types.str;
default = "#ffff00";
description = "The color of warning";
};
success = lib.mkOption {
type = lib.types.str;
default = "#00ff00";
description = "The color of success";
};
info = lib.mkOption {
type = lib.types.str;
default = "#0000ff";
description = "The color of info";
};
};
syntax = {
blend = lib.mkOption {
type = lib.types.bool;
default = true;
description = "Blend the colors";
};
keywords = lib.mkOption {
type = lib.types.str;
default = "#ff8000";
description = "The color of keywords";
};
functions = lib.mkOption {
type = lib.types.str;
default = "#0000ff";
description = "The color of functions";
};
properties = lib.mkOption {
type = lib.types.str;
default = "#ff00ff";
description = "The color of properties";
};
constants = lib.mkOption {
type = lib.types.str;
default = "#ff00ff";
description = "The color of constants";
};
strings = lib.mkOption {
type = lib.types.str;
default = "#00ff00";
description = "The color of variables";
};
numbers = lib.mkOption {
type = lib.types.str;
default = "#00ffff";
description = "The color of numbers";
};
structures = lib.mkOption {
type = lib.types.str;
default = "#ffff00";
description = "The color of structures";
};
types = lib.mkOption {
type = lib.types.str;
default = "#00ffff";
description = "The color of types";
};
};
ansi = {
blend = lib.mkOption {
type = lib.types.bool;
default = true;
description = "Blend the colors";
};
red = lib.mkOption {
type = lib.types.str;
default = "#ff0000";
description = "The color of red";
};
green = lib.mkOption {
type = lib.types.str;
default = "#00ff00";
description = "The color of green";
};
yellow = lib.mkOption {
type = lib.types.str;
default = "#ffff00";
description = "The color of yellow";
};
orange = lib.mkOption {
type = lib.types.str;
default = "#ff8000";
description = "The color of orange";
};
blue = lib.mkOption {
type = lib.types.str;
default = "#0000ff";
description = "The color of blue";
};
magenta = lib.mkOption {
type = lib.types.str;
default = "#ff00ff";
description = "The color of magenta";
};
cyan = lib.mkOption {
type = lib.types.str;
default = "#00ffff";
description = "The color of cyan";
};
};
};
config = lib.mkIf cfg.enable {
@@ -185,23 +301,35 @@ in
set_wallpaper = true;
wallpaper_tool = "Swww";
custom_colors = {
red = "#ff0000";
green = "#00ff00";
yellow = "#ffff00";
orange = "#ff8000";
blue = "#0000ff";
magenta = "#ff00ff";
cyan = "#00ffff";
custom_colors =
let
mkColor = category: color: {
color = cfg.${category}.${color};
blend = cfg.${category}.blend;
};
in
{
red = mkColor "ansi" "red";
green = mkColor "ansi" "green";
yellow = mkColor "ansi" "yellow";
orange = mkColor "ansi" "orange";
blue = mkColor "ansi" "blue";
magenta = mkColor "ansi" "magenta";
cyan = mkColor "ansi" "cyan";
warn = {
color = "#ffff00";
blend = false;
};
ok = {
color = "#00ff00";
blend = false;
};
keywords = mkColor "syntax" "keywords";
functions = mkColor "syntax" "functions";
constants = mkColor "syntax" "constants";
properties = mkColor "syntax" "properties";
strings = mkColor "syntax" "strings";
numbers = mkColor "syntax" "numbers";
structures = mkColor "syntax" "structures";
types = mkColor "syntax" "types";
danger = mkColor "semantic" "danger";
warning = mkColor "semantic" "warning";
success = mkColor "semantic" "success";
info = mkColor "semantic" "info";
};
custom_keywords = {

View File

@@ -64,33 +64,33 @@ hi Search guifg={{colors.on_tertiary.default.hex}} guibg={{colors.tertiary.defau
hi CmpItemKindCopilot guifg={{colors.cyan.default.hex}}
hi CmpItemKindNpm guifg={{colors.red.default.hex}}
hi Error guibg={{colors.error_container.default.hex}} guifg={{colors.on_error_container.default.hex}}
hi ErrorMsg guibg={{colors.error_container.default.hex}} guifg={{colors.on_error_container.default.hex}}
hi WarningMsg guibg={{colors.warn_container.default.hex}} guifg={{colors.on_warn_container.default.hex}}
hi NvimInternalError guibg={{colors.error.default.hex}} guifg={{colors.on_error.default.hex}}
hi Error guibg={{colors.danger_container.default.hex}} guifg={{colors.on_danger_container.default.hex}}
hi ErrorMsg guibg={{colors.danger_container.default.hex}} guifg={{colors.on_danger_container.default.hex}}
hi WarningMsg guibg={{colors.warning_container.default.hex}} guifg={{colors.on_warning_container.default.hex}}
hi NvimInternalError guibg={{colors.danger.default.hex}} guifg={{colors.on_danger.default.hex}}
hi DiagnosticError guifg={{colors.error.default.hex}}
hi DiagnosticWarn guifg={{colors.warn.default.hex}}
hi DiagnosticInfo guifg={{colors.blue.default.hex}}
hi DiagnosticError guifg={{colors.danger.default.hex}}
hi DiagnosticWarn guifg={{colors.warning.default.hex}}
hi DiagnosticInfo guifg={{colors.info.default.hex}}
hi DiagnosticHint guifg={{colors.outline.default.hex}}
hi DiagnosticOk guifg={{colors.ok.default.hex}}
hi DiagnosticOk guifg={{colors.success.default.hex}}
hi RedrawDebugNormal guibg={{colors.surface_variant.default.hex}} guifg={{colors.on_surface_variant.default.hex}}
hi RedrawDebugClear guibg={{colors.warn.default.hex}} guifg={{colors.on_warn.default.hex}}
hi RedrawDebugComposed guibg={{colors.ok.default.hex}} guifg={{colors.on_ok.default.hex}}
hi RedrawDebugRecompose guibg={{colors.error.default.hex}} guifg={{colors.on_error.default.hex}}
hi RedrawDebugClear guibg={{colors.warning.default.hex}} guifg={{colors.on_warning.default.hex}}
hi RedrawDebugComposed guibg={{colors.success.default.hex}} guifg={{colors.on_success.default.hex}}
hi RedrawDebugRecompose guibg={{colors.danger.default.hex}} guifg={{colors.on_danger.default.hex}}
hi DiagnosticUnderlineError gui=undercurl guisp={{colors.error.default.hex}}
hi DiagnosticUnderlineWarn gui=undercurl guisp={{colors.warn.default.hex}}
hi DiagnosticUnderlineInfo gui=undercurl guisp={{colors.blue.default.hex}}
hi DiagnosticUnderlineError gui=undercurl guisp={{colors.danger.default.hex}}
hi DiagnosticUnderlineWarn gui=undercurl guisp={{colors.warning.default.hex}}
hi DiagnosticUnderlineInfo gui=undercurl guisp={{colors.info.default.hex}}
hi DiagnosticUnderlineHint gui=undercurl guisp={{colors.outline.default.hex}}
hi DiagnosticUnderlineOk gui=undercurl guisp={{colors.ok.default.hex}}
hi DiagnosticDeprecated gui=strikethrough guisp={{colors.error.default.hex}}
hi DiagnosticUnderlineOk gui=undercurl guisp={{colors.success.default.hex}}
hi DiagnosticDeprecated gui=strikethrough guisp={{colors.danger.default.hex}}
hi SpellBad gui=undercurl guisp={{colors.green.default.hex}}
hi SpellCap gui=undercurl guisp={{colors.green.default.hex}}
hi SpellRare gui=undercurl guisp={{colors.green.default.hex}}
hi SpellLocal gui=undercurl guisp={{colors.green.default.hex}}
hi SpellBad gui=undercurl guisp={{colors.success.default.hex}}
hi SpellCap gui=undercurl guisp={{colors.success.default.hex}}
hi SpellRare gui=undercurl guisp={{colors.success.default.hex}}
hi SpellLocal gui=undercurl guisp={{colors.success.default.hex}}
hi DiffAdd guibg={{colors.green_container.default.hex}} guifg={{colors.on_green_container.default.hex}}
hi DiffChange guibg={{colors.yellow_container.default.hex}} guifg={{colors.on_yellow_container.default.hex}}
@@ -100,7 +100,7 @@ hi DiffText guibg={{colors.blue_container.default.hex}} guifg={{colors.on_blue_c
hi NeoTreeGitAdded guifg={{colors.green.default.hex}}
hi NeoTreeGitDeleted guifg={{colors.red.default.hex}}
hi NeoTreeGitModified guifg={{colors.yellow.default.hex}}
hi NeoTreeGitConflict guifg={{colors.error.default.hex}}
hi NeoTreeGitConflict guifg={{colors.danger.default.hex}}
hi NeoTreeGitUntracked guifg={{colors.blue.default.hex}}
hi NonText guifg={{colors.outline_variant.default.hex}}
@@ -117,7 +117,7 @@ hi Todo guibg={{colors.yellow_container.default.hex}} guifg={{colors.on_yellow_c
hi def link @comment.todo Todo
hi def link @comment.error Error
hi String guifg={{colors.green.default.hex}}
hi String guifg={{colors.strings.default.hex}}
hi Identifier guifg={{colors.on_surface.default.hex}}
hi Statement gui=bold guifg={{colors.on_surface.default.hex}}
@@ -131,22 +131,23 @@ hi def link @parameter Identifier
hi @lsp.mod.defaultLibrary gui=bold
hi @lsp.mod.readonly gui=italic
hi Constant guifg={{colors.magenta.default.hex}}
hi Constant guifg={{colors.constants.default.hex}}
hi def link @variable Constant
hi def link @field Constant
hi def link @property @field
hi @property guifg={{colors.properties.default.hex}}
hi def link @field @property
hi def link @label.json @property
hi def link @label.jsonc @label.json
hi def link @property.typescript @property
hi def link @lsp.type.property @property
hi def link @attribute Constant
hi def link @tag.attribute Constant
hi def link @attribute @property
hi def link @tag.attribute @property
hi def link @lsp.type.variable Constant
hi def link @lsp.typemod.variable.local Identifier
hi Keyword guifg={{colors.orange.default.hex}}
hi Special guifg={{colors.orange.default.hex}}
hi Keyword guifg={{colors.keywords.default.hex}}
hi Special guifg={{colors.keywords.default.hex}}
hi def link Character Keyword
hi def link Boolean Keyword
hi def link Repeat Keyword
@@ -156,13 +157,13 @@ hi def link Include Keyword
hi def link Conditional Keyword
hi def link @type.builtin Keyword
hi Number guifg={{colors.cyan.default.hex}}
hi Function guifg={{colors.cyan.default.hex}}
hi Number guifg={{colors.numbers.default.hex}}
hi Function guifg={{colors.functions.default.hex}}
hi Structure guifg={{colors.yellow.default.hex}}
hi Structure guifg={{colors.structures.default.hex}}
hi def link PreProc Structure
hi def link Tag Structure
hi Type gui=none guifg={{colors.blue.default.hex}}
hi Type gui=none guifg={{colors.types.default.hex}}
hi def link @lsp.type.interface Type
hi IlluminatedWordText gui=none guibg={{colors.surface_container_highest.default.hex}}