Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

refactor(frontend): theme css variables for tailwind (#8934)

Liu Ji24547bf1c9b7
diff --git a/frontend/naive-ui.config.ts b/frontend/naive-ui.config.ts
index a88f968577..502838ed3b 100644
--- a/frontend/naive-ui.config.ts
+++ b/frontend/naive-ui.config.ts
@@ -6,34 +6,31 @@ import {
NDateLocale,
} from "naive-ui";
import { computed } from "vue";
+import { callCssVariable } from "@/utils";
import { curLocale } from "./src/plugins/i18n";
-const callVar = (css: string) => {
- return getComputedStyle(document.documentElement).getPropertyValue(css);
-};
-
export const themeOverrides = computed((): GlobalThemeOverrides => {
return {
common: {
- primaryColor: callVar("--color-accent"),
- primaryColorHover: callVar("--color-accent-hover"),
- primaryColorPressed: callVar("--color-accent"),
+ primaryColor: callCssVariable("--color-accent"),
+ primaryColorHover: callCssVariable("--color-accent-hover"),
+ primaryColorPressed: callCssVariable("--color-accent"),
- successColor: callVar("--color-success"),
- successColorHover: callVar("--color-success-hover"),
- successColorPressed: callVar("--color-success"),
+ successColor: callCssVariable("--color-success"),
+ successColorHover: callCssVariable("--color-success-hover"),
+ successColorPressed: callCssVariable("--color-success"),
- warningColor: callVar("--color-warning"),
- warningColorHover: callVar("--color-warning-hover"),
- warningColorPressed: callVar("--color-warning"),
+ warningColor: callCssVariable("--color-warning"),
+ warningColorHover: callCssVariable("--color-warning-hover"),
+ warningColorPressed: callCssVariable("--color-warning"),
- infoColor: callVar("--color-info"),
- infoColorHover: callVar("--color-info-hover"),
- infoColorPressed: callVar("--color-info"),
+ infoColor: callCssVariable("--color-info"),
+ infoColorHover: callCssVariable("--color-info-hover"),
+ infoColorPressed: callCssVariable("--color-info"),
- errorColor: callVar("--color-error"),
- errorColorHover: callVar("--color-error-hover"),
- errorColorPressed: callVar("--color-error"),
+ errorColor: callCssVariable("--color-error"),
+ errorColorHover: callCssVariable("--color-error-hover"),
+ errorColorPressed: callCssVariable("--color-error"),
},
Button: {
color: "white",
@@ -47,24 +44,24 @@ export const themeOverrides = computed((): GlobalThemeOverrides => {
export const darkThemeOverrides = computed((): GlobalThemeOverrides => {
return {
common: {
- primaryColor: callVar("--color-matrix-green"),
- primaryColorHover: callVar("--color-matrix-green-hover"),
- primaryColorPressed: callVar("--color-matrix-green"),
+ primaryColor: callCssVariable("--color-matrix-green"),
+ primaryColorHover: callCssVariable("--color-matrix-green-hover"),
+ primaryColorPressed: callCssVariable("--color-matrix-green"),
},
Button: {
color: "transparent",
colorHover: "transparent",
colorFocus: "transparent",
colorPressed: "transparent",
- colorInfo: callVar("--color-matrix-green"),
- colorHoverInfo: callVar("--color-matrix-green-hover"),
- colorFocusInfo: callVar("--color-matrix-green"),
- borderInfo: callVar("--color-matrix-green"),
- borderHoverInfo: callVar("--color-matrix-green-hover"),
- borderFocusInfo: callVar("--color-matrix-green"),
+ colorInfo: callCssVariable("--color-matrix-green"),
+ colorHoverInfo: callCssVariable("--color-matrix-green-hover"),
+ colorFocusInfo: callCssVariable("--color-matrix-green"),
+ borderInfo: callCssVariable("--color-matrix-green"),
+ borderHoverInfo: callCssVariable("--color-matrix-green-hover"),
+ borderFocusInfo: callCssVariable("--color-matrix-green"),
},
Tabs: {
- tabTextColorCard: callVar("--color-control-placeholder"),
+ tabTextColorCard: callCssVariable("--color-control-placeholder"),
},
};
});
diff --git a/frontend/src/assets/css/tailwind.css b/frontend/src/assets/css/tailwind.css
index 611ee23528..b2bd256c44 100644
--- a/frontend/src/assets/css/tailwind.css
+++ b/frontend/src/assets/css/tailwind.css
@@ -1,66 +1,65 @@
:root {
/* indigo-600 */
- --color-accent: #4f46e5;
- --color-accent-tw: 79 70 229; /* same to --color-accent but used for tailwind css */
+ --color-accent: 79 70 229; /* #4f46e5 */
/* indigo-300 */
- --color-accent-disabled: #a5b4fc;
+ --color-accent-disabled: 165 180 252; /* #a5b4fc */
/* indigo-800 */
- --color-accent-hover: #3730a3;
+ --color-accent-hover: 55 48 163; /* #3730a3 */
/* white */
- --color-accent-text: #ffffff;
+ --color-accent-text: 255 255 255; /* #ffffff */
/* gray-900 */
- --color-main: #18181b;
+ --color-main: 24 24 27; /* #18181b */
/* gray-700 */
- --color-main-hover: #3f3f46;
+ --color-main-hover: 63 63 70; /* #3f3f46 */
/* white */
- --color-main-text: #ffffff;
+ --color-main-text: 255 255 255; /* #ffffff */
/* gray-700 */
- --color-control: #52525b;
+ --color-control: 82 82 91; /* #52525b */
/* gray-900 */
- --color-control-hover: #18181b;
+ --color-control-hover: 24 24 27; /* #18181b */
/* gray-500 */
- --color-control-light: #71717a;
+ --color-control-light: 113 113 122; /* #71717a */
/* gray-600 */
- --color-control-light-hover: #52525b;
+ --color-control-light-hover: 82 82 91; /* #52525b */
/* gray-100 */
- --color-control-bg: #f3f4f6;
+ --color-control-bg: 243 244 246; /* #f3f4f6 */
/* gray-200 */
- --color-control-bg-hover: #e5e7eb;
+ --color-control-bg-hover: 229 231 235; /* #e5e7eb */
/* gray-400 */
- --color-control-placeholder: #a1a1aa;
+ --color-control-placeholder: 161 161 170; /* #a1a1aa */
/* blue-600 */
- --color-info: #2563eb;
+ --color-info: 37 99 235; /* #2563eb */
/* blue-700 */
- --color-info-hover: #1d4ed8;
+ --color-info-hover: 29 78 216; /* #1d4ed8 */
/* yellow-500 */
- --color-warning: #f59e0b;
+ --color-warning: 245 158 11; /* #f59e0b */
/* yellow-700 */
- --color-warning-hover: #b45309;
+ --color-warning-hover: 180 83 9; /* #b45309 */
/* red-600 */
- --color-error: #dc2626;
+ --color-error: 220 38 38; /* #dc2626 */
/* red-700 */
- --color-error-hover: #b91c1c;
+ --color-error-hover: 185 28 28; /* #b91c1c */
/* green-600 */
- --color-success: #16a34a;
+ --color-success: 22 163 74; /* #16a34a */
/* green-700 */
- --color-success-hover: #15803d;
+ --color-success-hover: 21 128 61; /* #15803d */
/* gray-200 */
- --color-link-hover: #e5e7eb;
+ --color-link-hover: 229 231 235; /* #e5e7eb */
/* gray-200 */
- --color-block-border: #e5e7eb;
+ --color-block-border: 229 231 235; /* #e5e7eb */
/* gray-300 */
- --color-control-border: #d1d5db;
+ --color-control-border: 209 213 219; /* #d1d5db */
}
/*
@@ -69,12 +68,12 @@
*/
:root {
/* same as vs-dark theme's bg, not pure black. */
- --color-dark-bg: #1e1e1e;
+ --color-dark-bg: 30 30 30; /* #1e1e1e */
/* The Matrix green */
- --color-matrix-green: #00cc00;
+ --color-matrix-green: 0 204 0; /* #00cc00 */
/* The matrix green lighter */
- --color-matrix-green-hover: #88ff88;
+ --color-matrix-green-hover: 136 255 136; /* #88ff88 */
}
@tailwind base;
@@ -272,12 +271,6 @@
@apply visible z-50;
}
-@layer base {
- .bg-dark-bg {
- background-color: var(--color-dark-bg);
- }
-}
-
@layer utilities {
/* Chrome, Safari and Opera */
.hide-scrollbar::-webkit-scrollbar {
diff --git a/frontend/src/bbkit/BBAvatar.vue b/frontend/src/bbkit/BBAvatar.vue
index 27cc8821b7..75cb4e62fa 100644
--- a/frontend/src/bbkit/BBAvatar.vue
+++ b/frontend/src/bbkit/BBAvatar.vue
@@ -15,7 +15,7 @@
import isChinese from "is-chinese";
import { computed, withDefaults } from "vue";
import { SYSTEM_BOT_EMAIL } from "@/types";
-import { VueClass } from "@/utils";
+import { VueClass, callCssVariable } from "@/utils";
import { hashCode } from "./BBUtil";
import { BBAvatarSizeType } from "./types";
@@ -132,11 +132,7 @@ const initials = computed(() => {
const backgroundColor = computed(() => {
if (props.email === SYSTEM_BOT_EMAIL) {
- return (
- getComputedStyle(document.documentElement)
- .getPropertyValue("--color-accent")
- .trim() || DEFAULT_BRANDING_COLOR
- );
+ return callCssVariable("--color-accent") || DEFAULT_BRANDING_COLOR;
}
return (
props.backgroundColor ||
diff --git a/frontend/src/bbkit/BBBetaBadge.vue b/frontend/src/bbkit/BBBetaBadge.vue
index 5336c04bc3..f6a9d90048 100644
--- a/frontend/src/bbkit/BBBetaBadge.vue
+++ b/frontend/src/bbkit/BBBetaBadge.vue
@@ -1,7 +1,6 @@
<template>
<span
- class="text-white text-[10px] leading-4 px-[6px] py-[2px] rounded-lg select-none"
- style="background-color: var(--color-control)"
+ class="text-white text-[10px] leading-4 px-[6px] py-[2px] rounded-lg select-none bg-control"
:class="
corner
? 'absolute top-0 right-0 translate-x-[50%] translate-y-[-50%]'
diff --git a/frontend/src/components/Branch/BranchDetailView.vue b/frontend/src/components/Branch/BranchDetailView.vue
index 3bd7e56578..b7122750a7 100644
--- a/frontend/src/components/Branch/BranchDetailView.vue
+++ b/frontend/src/components/Branch/BranchDetailView.vue
@@ -227,7 +227,7 @@ const titleInputStyle = computed(() => {
"--n-font-size": "20px",
};
const border = state.isEditingTitle
- ? "1px solid var(--color-control-border)"
+ ? "1px solid rgb(var(--color-control-border))"
: "none";
style["--n-border"] = border;
style["--n-border-disabled"] = border;
diff --git a/frontend/src/components/Changelist/ChangelistDetail/NavBar/TitleEditor.vue b/frontend/src/components/Changelist/ChangelistDetail/NavBar/TitleEditor.vue
index 1960042724..258fe086e2 100644
--- a/frontend/src/components/Changelist/ChangelistDetail/NavBar/TitleEditor.vue
+++ b/frontend/src/components/Changelist/ChangelistDetail/NavBar/TitleEditor.vue
@@ -42,7 +42,7 @@ const style = computed(() => {
"--n-font-size": "20px",
};
const border = state.isEditing
- ? "1px solid var(--color-control-border)"
+ ? "1px solid rgb(var(--color-control-border))"
: "none";
style["--n-border"] = border;
style["--n-border-disabled"] = border;
diff --git a/frontend/src/components/IssueV1/components/DescriptionSection/DescriptionSection.vue b/frontend/src/components/IssueV1/components/DescriptionSection/DescriptionSection.vue
index c70b0e51ec..2a500ca0e5 100644
--- a/frontend/src/components/IssueV1/components/DescriptionSection/DescriptionSection.vue
+++ b/frontend/src/components/IssueV1/components/DescriptionSection/DescriptionSection.vue
@@ -40,7 +40,7 @@
:loading="state.isUpdating"
style="
width: 100%;
- --n-placeholder-color: var(--color-control-placeholder);
+ --n-placeholder-color: rgb(var(--color-control-placeholder));
"
type="textarea"
size="small"
diff --git a/frontend/src/components/IssueV1/components/HeaderSection/Title.vue b/frontend/src/components/IssueV1/components/HeaderSection/Title.vue
index 44d39aeb42..d4a088795e 100644
--- a/frontend/src/components/IssueV1/components/HeaderSection/Title.vue
+++ b/frontend/src/components/IssueV1/components/HeaderSection/Title.vue
@@ -52,7 +52,7 @@ const style = computed(() => {
};
const border =
viewMode.value === "EDIT"
- ? "1px solid var(--color-control-border)"
+ ? "1px solid rgb(var(--color-control-border))"
: "none";
style["--n-border"] = border;
style["--n-border-disabled"] = border;
diff --git a/frontend/src/components/MonacoEditor/plugins/useAdvices.ts b/frontend/src/components/MonacoEditor/plugins/useAdvices.ts
index 4ef7aae8c6..c3853120e0 100644
--- a/frontend/src/components/MonacoEditor/plugins/useAdvices.ts
+++ b/frontend/src/components/MonacoEditor/plugins/useAdvices.ts
@@ -2,8 +2,7 @@ import { maxBy } from "lodash-es";
import type { editor as Editor } from "monaco-editor";
import { unref, watchEffect } from "vue";
import type { MaybeRef } from "@/types";
-import { escapeMarkdown } from "@/utils";
-import { callVar } from "../themes/utils";
+import { escapeMarkdown, callCssVariable } from "@/utils";
import type { AdviceOption } from "../types";
export const useAdvices = async (
@@ -59,8 +58,8 @@ export const useAdvices = async (
const buildHoverMessage = (advice: AdviceOption) => {
const COLORS = {
- WARNING: callVar("--color-warning"),
- ERROR: callVar("--color-error"),
+ WARNING: callCssVariable("--color-warning"),
+ ERROR: callCssVariable("--color-error"),
};
const { severity, message, source } = advice;
diff --git a/frontend/src/components/MonacoEditor/themes/bb-dark.ts b/frontend/src/components/MonacoEditor/themes/bb-dark.ts
index ad180162e2..cc2fa9f446 100644
--- a/frontend/src/components/MonacoEditor/themes/bb-dark.ts
+++ b/frontend/src/components/MonacoEditor/themes/bb-dark.ts
@@ -1,19 +1,21 @@
import type { editor as Editor } from "monaco-editor";
-import { callVar } from "./utils";
+import { callCssVariable } from "@/utils";
export const getBBDarkTheme = (): Editor.IStandaloneThemeData => ({
base: "vs-dark",
inherit: true,
rules: [
{
- foreground: callVar("--color-matrix-green-hover"),
+ foreground: callCssVariable("--color-matrix-green-hover"),
token: "keyword",
},
],
colors: {
- "editor.foreground": callVar("--color-matrix-green"),
- "editorCursor.foreground": callVar("--color-matrix-green-hover"),
- "editorLineNumber.foreground": callVar("--color-matrix-green"),
- "editorLineNumber.activeForeground": callVar("--color-matrix-green-hover"),
+ "editor.foreground": callCssVariable("--color-matrix-green"),
+ "editorCursor.foreground": callCssVariable("--color-matrix-green-hover"),
+ "editorLineNumber.foreground": callCssVariable("--color-matrix-green"),
+ "editorLineNumber.activeForeground": callCssVariable(
+ "--color-matrix-green-hover"
+ ),
},
});
diff --git a/frontend/src/components/MonacoEditor/themes/bb.ts b/frontend/src/components/MonacoEditor/themes/bb.ts
index 0f614390ab..a862459dc9 100644
--- a/frontend/src/components/MonacoEditor/themes/bb.ts
+++ b/frontend/src/components/MonacoEditor/themes/bb.ts
@@ -1,13 +1,15 @@
import type { editor as Editor } from "monaco-editor";
-import { callVar } from "./utils";
+import { callCssVariable } from "@/utils";
export const getBBTheme = (): Editor.IStandaloneThemeData => ({
base: "vs",
inherit: true,
rules: [],
colors: {
- "editorCursor.foreground": callVar("--color-accent"),
- "editorLineNumber.foreground": callVar("--color-control-placeholder"),
- "editorLineNumber.activeForeground": callVar("--color-main"),
+ "editorCursor.foreground": callCssVariable("--color-accent"),
+ "editorLineNumber.foreground": callCssVariable(
+ "--color-control-placeholder"
+ ),
+ "editorLineNumber.activeForeground": callCssVariable("--color-main"),
},
});
diff --git a/frontend/src/components/MonacoEditor/themes/utils.ts b/frontend/src/components/MonacoEditor/themes/utils.ts
deleted file mode 100644
index f68904b5c8..0000000000
--- a/frontend/src/components/MonacoEditor/themes/utils.ts
+++ /dev/null
@@ -1,5 +0,0 @@
-export const callVar = (css: string) => {
- return getComputedStyle(document.documentElement)
- .getPropertyValue(css)
- .trim();
-};
diff --git a/frontend/src/components/v2/Button/ContextMenuButton.vue b/frontend/src/components/v2/Button/ContextMenuButton.vue
index bea3bf28ba..9fbfadd4ff 100644
--- a/frontend/src/components/v2/Button/ContextMenuButton.vue
+++ b/frontend/src/components/v2/Button/ContextMenuButton.vue
@@ -121,7 +121,7 @@ const dropdownButtonStyle = (action: ContextMenuButtonAction) => {
};
if (action.props?.type === "primary") {
style["--n-padding"] = "0 8px";
- style["border-left"] = "0.5px solid var(--color-accent-hover)";
+ style["border-left"] = "0.5px solid rgb(var(--color-accent-hover))";
}
return style;
};
diff --git a/frontend/src/utils/css.ts b/frontend/src/utils/css.ts
new file mode 100644
index 0000000000..053bd94b0d
--- /dev/null
+++ b/frontend/src/utils/css.ts
@@ -0,0 +1,48 @@
+export const rgbToHex = (r: number, g: number, b: number) => {
+ const hex = [r, g, b]
+ .map((decimal) => decimal.toString(16).padStart(2, "0"))
+ .join("");
+ return `#${hex}`;
+};
+
+export const hexToRgb = (hex: string) => {
+ hex = hex.replace(/^#/, "");
+
+ const hexValues: string[] = [];
+ if (hex.length === 3) {
+ hexValues.push(hex.charAt(0) + hex.charAt(0));
+ hexValues.push(hex.charAt(1) + hex.charAt(1));
+ hexValues.push(hex.charAt(2) + hex.charAt(2));
+ } else {
+ hexValues.push(hex.charAt(0) + hex.charAt(1));
+ hexValues.push(hex.charAt(2) + hex.charAt(3));
+ hexValues.push(hex.charAt(4) + hex.charAt(5));
+ }
+ return hexValues.map((str) => parseInt(str, 16));
+};
+
+/**
+ *
+ * @param name css variable name including "--" prefix
+ * @param convertColorFromTailwindToHex Typically, tailwindcss use "r g b" format colors to combine with opacity values.
+ * @returns
+ */
+export const callCssVariable = (
+ name: string,
+ convertColorFromTailwindToHex = true
+) => {
+ const value = getComputedStyle(document.documentElement)
+ .getPropertyValue(name)
+ .trim();
+ if (convertColorFromTailwindToHex) {
+ const matches = value.match(/^(\d+) (\d+) (\d+)$/);
+ if (matches) {
+ const r = parseInt(matches[1], 10);
+ const g = parseInt(matches[2], 10);
+ const b = parseInt(matches[3], 10);
+ return rgbToHex(r, g, b);
+ }
+ }
+
+ return value;
+};
diff --git a/frontend/src/utils/customTheme.ts b/frontend/src/utils/customTheme.ts
index d48d4cdf11..d1ad0cff38 100644
--- a/frontend/src/utils/customTheme.ts
+++ b/frontend/src/utils/customTheme.ts
@@ -1,13 +1,22 @@
import { useLocalStorage } from "@vueuse/core";
import { useI18n } from "vue-i18n";
+import { hexToRgb } from "./css";
export const applyCustomTheme = (theme: string) => {
const rootElement = document.documentElement;
if (theme === "lixiang") {
- rootElement.style.setProperty("--color-accent", "#00665f");
- rootElement.style.setProperty("--color-accent-tw", "0 102 95");
- rootElement.style.setProperty("--color-accent-disabled", "#b8c3c3");
- rootElement.style.setProperty("--color-accent-hover", "#00554f");
+ rootElement.style.setProperty(
+ "--color-accent",
+ hexToRgb("#00665f").join(" ")
+ );
+ rootElement.style.setProperty(
+ "--color-accent-disabled",
+ hexToRgb("#b8c3c3").join(" ")
+ );
+ rootElement.style.setProperty(
+ "--color-accent-hover",
+ hexToRgb("#00554f").join(" ")
+ );
}
};
diff --git a/frontend/src/utils/index.ts b/frontend/src/utils/index.ts
index e8c9b95143..1d58d001fa 100644
--- a/frontend/src/utils/index.ts
+++ b/frontend/src/utils/index.ts
@@ -1,3 +1,4 @@
+export * from "./css";
export * from "./collections";
export * from "./activity";
export * from "./database";
diff --git a/frontend/src/views/sql-editor/EditorCommon/ResultView/EmptyView.vue b/frontend/src/views/sql-editor/EditorCommon/ResultView/EmptyView.vue
index 145dfce7fa..80d41fa2ef 100644
--- a/frontend/src/views/sql-editor/EditorCommon/ResultView/EmptyView.vue
+++ b/frontend/src/views/sql-editor/EditorCommon/ResultView/EmptyView.vue
@@ -1,9 +1,7 @@
<template>
<div
class="text-md font-normal"
- :class="[
- dark ? 'text-[var(--color-matrix-green-hover)]' : 'text-control-light',
- ]"
+ :class="[dark ? 'text-matrix-green-hover' : 'text-control-light']"
>
{{ $t("sql-editor.no-rows-found") }}
</div>
diff --git a/frontend/src/views/sql-editor/EditorCommon/ResultView/ErrorView.vue b/frontend/src/views/sql-editor/EditorCommon/ResultView/ErrorView.vue
index 36647cb102..c31da9f575 100644
--- a/frontend/src/views/sql-editor/EditorCommon/ResultView/ErrorView.vue
+++ b/frontend/src/views/sql-editor/EditorCommon/ResultView/ErrorView.vue
@@ -1,9 +1,7 @@
<template>
<div
class="text-md font-normal flex items-center gap-x-3"
- :class="[
- dark ? 'text-[var(--color-matrix-green-hover)]' : 'text-control-light',
- ]"
+ :class="[dark ? 'text-matrix-green-hover' : 'text-control-light']"
>
<span>{{ error }}</span>
<slot name="suffix" />
diff --git a/frontend/src/views/sql-editor/EditorCommon/ResultView/SingleResultViewV1.vue b/frontend/src/views/sql-editor/EditorCommon/ResultView/SingleResultViewV1.vue
index d141aa5e42..5b67e2039d 100644
--- a/frontend/src/views/sql-editor/EditorCommon/ResultView/SingleResultViewV1.vue
+++ b/frontend/src/views/sql-editor/EditorCommon/ResultView/SingleResultViewV1.vue
@@ -105,9 +105,7 @@
<template v-else-if="viewMode === 'AFFECTED-ROWS'">
<div
class="text-md font-normal flex items-center gap-x-1"
- :class="[
- dark ? 'text-[var(--color-matrix-green-hover)]' : 'text-control-light',
- ]"
+ :class="[dark ? 'text-matrix-green-hover' : 'text-control-light']"
>
<span>{{ extractSQLRowValue(result.rows[0].values[0]) }}</span>
<span>rows affected</span>
diff --git a/frontend/src/views/sql-editor/SQLEditorPage.vue b/frontend/src/views/sql-editor/SQLEditorPage.vue
index 3032bbe361..59b9ec99c3 100644
--- a/frontend/src/views/sql-editor/SQLEditorPage.vue
+++ b/frontend/src/views/sql-editor/SQLEditorPage.vue
@@ -302,13 +302,13 @@ useEmitteryEventListener(
}
</style>
-<style scoped>
+<style scoped lang="postcss">
.sqleditor--wrapper {
+ /*
color: var(--base);
--base: #444;
- --font-code: "Source Code Pro", monospace;
- --color-branding: #4f46e5;
--border-color: rgba(200, 200, 200, 0.2);
+ */
@apply w-full flex-1 overflow-hidden flex flex-col;
}
diff --git a/frontend/src/views/sql-editor/SecondarySidebar/SecondaryGutterBar/SecondaryGutterBar.vue b/frontend/src/views/sql-editor/SecondarySidebar/SecondaryGutterBar/SecondaryGutterBar.vue
index fd58ec4558..0e8b2dba3d 100644
--- a/frontend/src/views/sql-editor/SecondarySidebar/SecondaryGutterBar/SecondaryGutterBar.vue
+++ b/frontend/src/views/sql-editor/SecondarySidebar/SecondaryGutterBar/SecondaryGutterBar.vue
@@ -3,21 +3,21 @@
<div class="divide-y border-b">
<div
v-if="showInfoPane"
- class="gutter-bar--tab"
+ class="gutter-bar--tab writing-vertical-rl"
:class="[activeTab === 'INFO' && 'gutter-bar--tab-active']"
@click="handleClickTab('INFO')"
>
{{ $t("common.info") }}
</div>
<div
- class="gutter-bar--tab"
+ class="gutter-bar--tab writing-vertical-rl"
:class="[activeTab === 'SHEET' && 'gutter-bar--tab-active']"
@click="handleClickTab('SHEET')"
>
{{ $t("sheet.sheet") }}
</div>
<div
- class="gutter-bar--tab"
+ class="gutter-bar--tab writing-vertical-rl"
:class="[activeTab === 'HISTORY' && 'gutter-bar--tab-active']"
@click="handleClickTab('HISTORY')"
>
@@ -115,7 +115,7 @@ watch(
<style lang="postcss" scoped>
.gutter-bar--tab {
- @apply writing-vertical-rl px-1 py-4 bg-white cursor-pointer select-none;
+ @apply px-1 py-4 bg-white cursor-pointer select-none;
}
.gutter-bar--tab.gutter-bar--tab-active {
@apply bg-gray-100;
diff --git a/frontend/src/views/sql-editor/TabList/TabItem/TabItem.vue b/frontend/src/views/sql-editor/TabList/TabItem/TabItem.vue
index cc9d0ece54..d93d7912d4 100644
--- a/frontend/src/views/sql-editor/TabList/TabItem/TabItem.vue
+++ b/frontend/src/views/sql-editor/TabList/TabItem/TabItem.vue
@@ -87,9 +87,9 @@ const isCurrentTab = computed(() => props.tab.id === currentTabId.value);
}
.tab-item.admin .body {
- @apply text-[var(--color-matrix-green-hover)];
+ @apply text-matrix-green-hover;
}
.tab-item.admin.current .body {
- @apply !bg-dark-bg border-[var(--color-matrix-green-hover)];
+ @apply !bg-dark-bg border-matrix-green-hover;
}
</style>
diff --git a/frontend/src/views/sql-editor/TabList/TabList.vue b/frontend/src/views/sql-editor/TabList/TabList.vue
index 13d9cc1ea4..d2317624c5 100644
--- a/frontend/src/views/sql-editor/TabList/TabList.vue
+++ b/frontend/src/views/sql-editor/TabList/TabList.vue
@@ -9,7 +9,7 @@
v-model="tabStore.tabIdList"
item-key="id"
animation="300"
- class="tab-list"
+ class="tab-list hide-scrollbar"
:class="{
'more-left': scrollState.moreLeft,
'more-right': scrollState.moreRight,
@@ -290,6 +290,6 @@ useEmitteryEventListener(
}
.tab-list {
- @apply flex flex-nowrap overflow-x-auto max-w-full hide-scrollbar overscroll-none;
+ @apply flex flex-nowrap overflow-x-auto max-w-full overscroll-none;
}
</style>
diff --git a/frontend/src/views/sql-editor/TerminalPanel/TerminalPanelV1.vue b/frontend/src/views/sql-editor/TerminalPanel/TerminalPanelV1.vue
index 2f23f2ff63..b355355708 100644
--- a/frontend/src/views/sql-editor/TerminalPanel/TerminalPanelV1.vue
+++ b/frontend/src/views/sql-editor/TerminalPanel/TerminalPanelV1.vue
@@ -39,7 +39,7 @@
<div
v-if="query.resultSet?.error"
- class="p-2 pb-1 text-md font-normal text-[var(--color-matrix-green-hover)]"
+ class="p-2 pb-1 text-md font-normal text-matrix-green-hover"
>
{{ $t("sql-editor.connection-lost") }}
</div>
diff --git a/frontend/tailwind.config.js b/frontend/tailwind.config.js
index a503b1f1f0..597c0782e9 100644
--- a/frontend/tailwind.config.js
+++ b/frontend/tailwind.config.js
@@ -36,43 +36,50 @@ module.exports = {
"4xl": "2160px",
},
colors: {
- accent: "var(--color-accent)",
- "accent-tw": "rgb(var(--color-accent-tw) / <alpha-value>)",
- "accent-disabled": "var(--color-accent-disabled)",
- "accent-hover": "var(--color-accent-hover)",
- "accent-text": "var(--color-accent-text)",
+ accent: "rgb(var(--color-accent) / <alpha-value>)",
+ "accent-disabled": "rgb(var(--color-accent-disabled) / <alpha-value>)",
+ "accent-hover": "rgb(var(--color-accent-hover) / <alpha-value>)",
+ "accent-text": "rgb(var(--color-accent-text) / <alpha-value>)",
- main: "var(--color-main)",
- "main-hover": "var(--color-main-hover)",
- "main-text": "var(--color-main-text)",
+ main: "rgb(var(--color-main) / <alpha-value>)",
+ "main-hover": "rgb(var(--color-main-hover) / <alpha-value>)",
+ "main-text": "rgb(var(--color-main-text) / <alpha-value>)",
- control: "var(--color-control)",
- "control-hover": "var(--color-control-hover)",
+ control: "rgb(var(--color-control) / <alpha-value>)",
+ "control-hover": "rgb(var(--color-control-hover) / <alpha-value>)",
- "control-light": "var(--color-control-light)",
- "control-light-hover": "var(--color-control-light-hover)",
+ "control-light": "rgb(var(--color-control-light) / <alpha-value>)",
+ "control-light-hover":
+ "rgb(var(--color-control-light-hover) / <alpha-value>)",
- "control-bg": "var(--color-control-bg)",
- "control-bg-hover": "var(--color-control-bg-hover)",
+ "control-bg": "rgb(var(--color-control-bg) / <alpha-value>)",
+ "control-bg-hover":
+ "rgb(var(--color-control-bg-hover) / <alpha-value>)",
- "control-placeholder": "var(--color-control-placeholder)",
+ "control-placeholder":
+ "rgb(var(--color-control-placeholder) / <alpha-value>)",
- info: "var(--color-info)",
- "info-hover": "var(--color-info-hover)",
+ info: "rgb(var(--color-info) / <alpha-value>)",
+ "info-hover": "rgb(var(--color-info-hover) / <alpha-value>)",
- warning: "var(--color-warning)",
- "warning-hover": "var(--color-warning-hover)",
+ warning: "rgb(var(--color-warning) / <alpha-value>)",
+ "warning-hover": "rgb(var(--color-warning-hover) / <alpha-value>)",
- error: "var(--color-error)",
- "error-hover": "var(--color-error-hover)",
+ error: "rgb(var(--color-error) / <alpha-value>)",
+ "error-hover": "rgb(var(--color-error-hover) / <alpha-value>)",
- success: "var(--color-success)",
- "success-hover": "var(--color-success-hover)",
+ success: "rgb(var(--color-success) / <alpha-value>)",
+ "success-hover": "rgb(var(--color-success-hover) / <alpha-value>)",
- "link-hover": "var(--color-link-hover)",
+ "link-hover": "rgb(var(--color-link-hover) / <alpha-value>)",
- "block-border": "var(--color-block-border)",
- "control-border": "var(--color-control-border)",
+ "block-border": "rgb(var(--color-block-border) / <alpha-value>)",
+ "control-border": "rgb(var(--color-control-border) / <alpha-value>)",
+
+ "dark-bg": "rgb(var(--color-dark-bg) / <alpha-value>)",
+ "matrix-green": "rgb(var(--color-matrix-green) / <alpha-value>)",
+ "matrix-green-hover":
+ "rgb(var(--color-matrix-green-hover) / <alpha-value>)",
},
fontFamily: {
sans: ["Inter var", ...defaultTheme.fontFamily.sans],