From 19654930542e8b5749ba79f3ddbe8577a44386c0 Mon Sep 17 00:00:00 2001 From: Red J Adaya Date: Sun, 25 Feb 2024 04:46:04 +0800 Subject: [PATCH] Lines css vars (#328) * css variables for sidebar * type * line css vars * lines css vars --- src/app/common/themes/themes.less | 25 +++++++++++++ src/app/line/line.less | 59 ++++++++++++++++--------------- src/app/line/lines.less | 6 ++-- 3 files changed, 58 insertions(+), 32 deletions(-) diff --git a/src/app/common/themes/themes.less b/src/app/common/themes/themes.less index a15f81f2..92bd3f83 100644 --- a/src/app/common/themes/themes.less +++ b/src/app/common/themes/themes.less @@ -82,6 +82,14 @@ @main-content-bottom-background: #333; :root { + --app-accent-color: rgb(88, 193, 66); + --app-error-color: rgb(204, 0, 0); + --app-warning-color: rgb(255, 165, 0); + --app-scrollbar-thumb-color: rgb(134, 134, 134); + + --app-text-color: rgb(236, 238, 236); + + --app-border-color: #333; --primary-text-color: #eceeec; --primary-border-color: #333; @@ -91,4 +99,21 @@ --sidebar-workspace-active-color: rgba(241, 246, 243, 0.08); --sidebar-separator-color: rgba(241, 246, 243, 0.08); --sidebar-settings-color: #ffffff; + + --line-text-color: #d3d7cf; + --line-selected-bg-color: rgba(255, 255, 255, 0.1); + --line-active-border-color: rgba(88, 193, 66, 0.8); + --line-selected-border-left-color: #ccc; + --line-selected-error-border-color: rgba(204, 0, 0, 0.8); + --line-selected-error-bg-color: rgb(19, 4, 3); + --line-error-bg-color: rgba(200, 0, 0, 0.1); + --line-error-border-left-color: --line-selected-error-border-color; + --line-simple-text-color: rgba(236, 238, 236, 0.6); + --line-meta-text-color: rgb(139, 145, 138); + --line-meta-user-color: rgba(140, 184, 232); + --line-svg-color: rgba(236, 238, 236, 0.6); + --line-svg-hover-color: rgba(236, 238, 236, 1); + --line-sidebar-message-color: rgb(196, 160, 0); + + --term-error-color: rgb(204, 0, 0); } diff --git a/src/app/line/line.less b/src/app/line/line.less index 8b15a538..14237802 100644 --- a/src/app/line/line.less +++ b/src/app/line/line.less @@ -30,33 +30,33 @@ } &.line-invalid { - color: @term-white; + color: var(--line-text-color); margin-left: 5px; } &.selected { .line-mask { - border-left: 4px solid #ccc; + border-left: 4px solid var(--line-selected-border-left-color); } &.has-error { .line-mask { - border-left: 4px solid rgba(@error-red-brightened, 0.8); + border-left: 4px solid var(--line-selected-error-border-color); } } } &.active.selected { .line-mask { - background-color: rgba(255, 255, 255, 0.1); - border: 2px solid rgba(@wave-green, 0.8); - border-left: 4px solid rgba(@wave-green, 0.8); + background-color: var(--line-selected-bg-color); + border: 2px solid var(--line-active-border-color); + border-left: 4px solid var(--line-active-border-color); } &.has-error { .line-mask { - border: 2px solid rgba(@error-red, 0.8); - border-left: 4px solid rgba(@error-red, 0.8); + border: 2px solid var(--line-selected-error-border-color); + border-left: 4px solid var(--line-selected-error-border-color); } } } @@ -72,13 +72,13 @@ pointer-events: none; &.error-mask { - background-color: rgba(200, 0, 0, 0.1); - border-left: 4px solid rgba(@error-red, 0.8); + background-color: var(--line-error-bg-color); + border-left: 4px solid var(--line-error-border-left-color); } } .load-error-text { - color: @term-red; + color: var(--term-error-color); padding-top: 5px; } @@ -87,7 +87,7 @@ } .sidebar-message { - color: @term-yellow; + color: var(--line-sidebar-message-color); } .focus-indicator { @@ -98,7 +98,7 @@ &.line-simple { font-size: 11px; line-height: 1.2; - color: rgba(@base-color, 0.6); + color: var(--line-simple-text-color); .simple-line-header { display: flex; @@ -122,22 +122,22 @@ margin-left: 0.5em; margin-right: 0.5em; vertical-align: text-top; - fill: @base-color; + fill: var(--app-text-color); } .success { - color: @wave-green; - fill: @wave-green; + color: var(--app-accent-color); + fill: var(--app-accent-color); } .fail { - color: @error-red; - fill: @error-red; + color: var(--app-error-color); + fill: var(--app-error-color); } .warning { - color: @warning-yellow; - fill: @warning-yellow; + color: var(--app-warning-color); + fill: var(--app-warning-color); } } @@ -195,7 +195,7 @@ } .meta.meta-line1 { - color: @text-caption; + color: var(--line-meta-text-color); } .meta.meta-line2 { @@ -220,7 +220,8 @@ flex-direction: row; .user { - color: lighten(@soft-blue, 10%); + // color: lighten(@soft-blue, 10%); + color: var(--line-meta-user-color); font-weight: bold; margin-top: 1px; margin-right: 10px; @@ -237,7 +238,7 @@ svg { width: 1em; margin-right: 0.5em; - fill: rgba(@base-color, 0.6); + fill: var(--line-svg-color); } } @@ -250,9 +251,9 @@ border-radius: 50%; line-height: 1em; svg { - fill: rgba(@base-color, 0.6); + fill: var(--line-svg-color); &:hover { - fill: @base-color; + fill: var(--line-svg-hover-color); } } } @@ -279,7 +280,7 @@ .cmdtext-overflow { flex-shrink: 0; padding-right: 2px; - color: @term-white; + color: var(--line-text-color); cursor: pointer; } } @@ -294,7 +295,7 @@ .cmdtext-expanded { white-space: pre; - color: @term-white; + color: var(--line-text-color); padding-bottom: 5px; } } @@ -358,13 +359,13 @@ padding: 2px 5px 0px 5px; display: inline-block; font-size: 10px; - color: @term-white; + color: var(--line-text-color); background-color: #151715; } .cmd-rtnstate-diff { font-family: var(--termfontfamily); - color: @term-white; + color: var(--line-text-color); white-space: pre; margin-left: 10px; padding-left: 10px; diff --git a/src/app/line/lines.less b/src/app/line/lines.less index 18753307..da577ab9 100644 --- a/src/app/line/lines.less +++ b/src/app/line/lines.less @@ -20,7 +20,7 @@ &:focus, &:focus-within { &::-webkit-scrollbar-thumb { - background-color: @scrollbar-thumb !important; + background-color: var(--app-scrollbar-thumb-color) !important; } } @@ -35,7 +35,7 @@ .line-sep-labeled { display: flex; align-items: center; - color: @text-caption; + color: var(--line-meta-text-color); font-family: var(--termfontfamily); line-height: var(--termlineheight); font-size: var(--termfontsize); @@ -60,6 +60,6 @@ .line-sep { width: 100%; height: 1px; - border-bottom: 1px solid @thin-border-color; + border-bottom: 1px solid var(--app-border-color); } }