π₯ π₯ π₯ A Free & Self-hostable Airtable Alternative
TypeScript airtableairtable-alternativeautomatic-apihacktoberfestlow-codeno-codeno-code-databaseno-code-platformpostgresqlrest-apirestful-apispreadsheetsqliteswagger
fix(nc-gui): add var colors in windi css config
Ramesh Maneed5587d77395
diff --git a/packages/nc-gui/assets/css/theme-overrides.scss b/packages/nc-gui/assets/css/theme-overrides.scssindex 9f19b29876..18ece1df01 100644--- a/packages/nc-gui/assets/css/theme-overrides.scss+++ b/packages/nc-gui/assets/css/theme-overrides.scss@@ -126,6 +126,18 @@ body {}}+ .ant-menu {+ @apply bg-nc-bg-default;+ }++ // Tabs+ .ant-tabs-bottom > .ant-tabs-nav:before,+ .ant-tabs-bottom > div > .ant-tabs-nav:before,+ .ant-tabs-top > .ant-tabs-nav:before,+ .ant-tabs-top > div > .ant-tabs-nav:before {+ @apply border-nc-border-gray-medium;+ }+// Form item label.ant-form-item-label > label {@apply text-nc-content-gray;diff --git a/packages/nc-gui/components/dashboard/settings/UIAclTabs.vue b/packages/nc-gui/components/dashboard/settings/UIAclTabs.vueindex 82d9c74bce..e3a0b67025 100644--- a/packages/nc-gui/components/dashboard/settings/UIAclTabs.vue+++ b/packages/nc-gui/components/dashboard/settings/UIAclTabs.vue@@ -18,5 +18,3 @@ const { base } = storeToRefs(useBase())</a-tab-pane></a-tabs></template>--<style scoped></style>diff --git a/packages/nc-gui/components/nc/Tabs.vue b/packages/nc-gui/components/nc/Tabs.vueindex c758de1b20..9059c8d832 100644--- a/packages/nc-gui/components/nc/Tabs.vue+++ b/packages/nc-gui/components/nc/Tabs.vue@@ -42,13 +42,13 @@ const props = defineProps<{.nc-tabs {.ant-tabs-tab {- @apply px-2 text-gray-600 !hover:text-gray-800;+ @apply px-2 text-nc-content-gray-subtle2 !hover:text-nc-content-gray;}.ant-tabs-tab.ant-tabs-tab-active .ant-tabs-tab-btn {- @apply text-brand-500;+ @apply text-nc-content-brand;}.ant-tabs-tab.ant-tabs-tab-active:hover .ant-tabs-tab-btn {- @apply text-brand-600;+ @apply text-nc-content-brand-disabled;}.ant-tabs-nav {@@ -56,7 +56,7 @@ const props = defineProps<{}.ant-tabs-ink-bar {- @apply bg-brand-500 !rounded-t-xl;+ @apply bg-nc-content-brand !rounded-t-xl;}&.theme-ai {diff --git a/packages/nc-gui/components/project/View.vue b/packages/nc-gui/components/project/View.vueindex e7218c1cd1..4cc54e2f54 100644--- a/packages/nc-gui/components/project/View.vue+++ b/packages/nc-gui/components/project/View.vue@@ -325,7 +325,7 @@ onMounted(() => {}}:deep(.ant-tabs-tab .tab-title) {- @apply text-gray-500;+ @apply text-nc-content-gray-muted;}:deep(.ant-tabs-tab-active .tab-title) {@apply text-primary;diff --git a/packages/nc-gui/components/smartsheet/ApiSnippet.vue b/packages/nc-gui/components/smartsheet/ApiSnippet.vueindex 7910d5e836..61d8bf0f2b 100644--- a/packages/nc-gui/components/smartsheet/ApiSnippet.vue+++ b/packages/nc-gui/components/smartsheet/ApiSnippet.vue@@ -165,7 +165,7 @@ watch(activeLang, (newLang) => {</template><LazyMonacoEditor- class="h-[60vh] border-1 border-gray-100 py-4 rounded-sm"+ class="h-[60vh] border-1 border-nc-border-gray-light py-4 rounded-sm":model-value="code":read-only="true"lang="typescript"diff --git a/packages/nc-gui/components/smartsheet/details/Api.vue b/packages/nc-gui/components/smartsheet/details/Api.vueindex 1f84e619ad..94609d77bd 100644--- a/packages/nc-gui/components/smartsheet/details/Api.vue+++ b/packages/nc-gui/components/smartsheet/details/Api.vue@@ -193,7 +193,7 @@ const supportedDocs = [<div class="flex gap-4 max-w-[1000px] mx-auto h-full"><NcMenu class="nc-api-snippets-menu !h-full w-[252px] min-w-[252px] nc-scrollbar-thin !pr-3"><div- class="p-2 text-xs text-gray-500 uppercase font-semibold"+ class="p-2 text-xs text-nc-content-gray-muted uppercase font-semibold":style="{letterSpacing: '0.3px',}"@@ -235,7 +235,7 @@ const supportedDocs = [:href="doc.href"target="_blank"rel="noopener noreferrer"- class="!text-gray-700 text-small leading-[18px] !no-underline !hover:underline"+ class="!text-nc-content-gray-subtle text-small leading-[18px] !no-underline !hover:underline">{{ doc.title }}</a>@@ -253,7 +253,7 @@ const supportedDocs = []"type="text"size="small"- class="!hover:bg-gray-200"+ class="!hover:bg-nc-bg-gray-medium"@click="onCopyToClipboard"><div class="flex items-center gap-2 text-small leading-[18px] min-w-80px justify-center">@@ -261,8 +261,8 @@ const supportedDocs = [:icon="isCopied ? 'circleCheck' : 'copy'"class="h-4 w-4":class="{- 'text-gray-700': !isCopied,- 'text-green-700': isCopied,+ 'text-nc-content-gray-subtle': !isCopied,+ 'text-nc-content-green-dark': isCopied,}"/>{{ isCopied ? $t('general.copied') : $t('general.copy') }}@@ -281,7 +281,7 @@ const supportedDocs = [</NcTabs><Suspense><MonacoEditor- class="h-[calc(100%_-_36px)] !bg-gray-50 pl-2"+ class="h-[calc(100%_-_36px)] !bg-nc-bg-gray-extralight pl-2":model-value="code":read-only="true"lang="typescript"@@ -340,13 +340,13 @@ const supportedDocs = [@apply border-r-0 !py-0;:deep(.ant-menu-item) {- @apply h-7 leading-5 my-1.5 px-2 text-gray-700 flex items-center;+ @apply h-7 leading-5 my-1.5 px-2 text-nc-content-gray-subtle flex items-center;.nc-menu-item-inner {@apply text-small leading-[18px] text-current font-weight-500;}&:hover:not(.active-menu) {- @apply !bg-gray-100;+ @apply !bg-nc-bg-gray-light;}&.active-menu {@@ -381,7 +381,7 @@ const supportedDocs = [<style lang="scss">.nc-api-clents-tab-wrapper {- @apply bg-gray-50 border-1 border-gray-200 rounded-lg flex-1;+ @apply bg-nc-bg-gray-extralight border-1 border-nc-border-gray-medium rounded-lg flex-1 overflow-hidden;.monaco-editor {@apply !border-0 !rounded-none pr-3;@@ -392,8 +392,11 @@ const supportedDocs = [.monaco-editor,.monaco-diff-editor,.monaco-component {- --vscode-editor-background: #f9f9fa;- --vscode-editorGutter-background: #f9f9fa;+ --vscode-editor-background: var(--nc-bg-gray-extralight);+ --vscode-editorGutter-background: var(--nc-bg-gray-extralight);+ --vscode-editorStickyScroll-background: var(--nc-bg-gray-extralight);+ --vscode-focusBorder: transparent;+ --vscode-editorStickyScroll-shadow: var(--nc-border-gray-light);}}</style>diff --git a/packages/nc-gui/layouts/base.vue b/packages/nc-gui/layouts/base.vueindex 01581474f8..c45a9e8b5d 100644--- a/packages/nc-gui/layouts/base.vue+++ b/packages/nc-gui/layouts/base.vue@@ -125,10 +125,10 @@ hooks.hook('page:finish', () => {</template></a-layout-header>- <NcTooltip placement="left" class="nc-lang-btn-wrapper">+ <NcTooltip v-if="!signedIn && !route.params.baseId && !route.params.erdUuid" placement="left" class="nc-lang-btn-wrapper"><template #title>{{ $t('labels.community.communityTranslated') }}</template>- <LazyGeneralLanguage v-if="!signedIn && !route.params.baseId && !route.params.erdUuid" class="nc-lang-btn" />+ <LazyGeneralLanguage class="nc-lang-btn" /></NcTooltip><div class="w-full h-full overflow-hidden nc-layout-base-inner">diff --git a/packages/nc-gui/utils/colorsUtils.ts b/packages/nc-gui/utils/colorsUtils.tsindex d5baa7b5b9..1e3c743d6b 100644--- a/packages/nc-gui/utils/colorsUtils.ts+++ b/packages/nc-gui/utils/colorsUtils.ts@@ -509,6 +509,20 @@ export const themeV4Colors = {},}+/**+ * In our WindiCSS config, we already added `themeV3Colors`.+ * To add `themeV4Colors` without conflicts, we create a new object+ * with all top-level keys prefixed by `nc-` (e.g., `gray` β `nc-gray`).+ *+ * This keeps both V3 and V4 colors available in the theme without overwriting each other.+ */+export const themeV4ColorsWithNcPrefix: {+ [K in keyof typeof themeV4Colors as `nc-${K}`]: (typeof themeV4Colors)[K]+} = Object.entries(themeV4Colors).reduce((acc, [key, value]) => {+ acc[`nc-${key}` as `nc-${string}`] = value+ return acc+}, {} as any)+/*** ### Light Theme Configuration* In this project, we've integrated a custom WindiCSS configuration that aligns with our Figma design system.@@ -530,13 +544,13 @@ export const themeV4Colors = {* ###### Text Color* To apply a text color, you can use:* ```html- * <p class="text-nc-content-grey-subtle">This is subtle grey text.</p>+ * <p class="text-nc-content-gray-subtle">This is subtle gray text.</p>* ```** ###### Border Color* To apply a border color, you can use:* ```html- * <div class="border-nc-border-gray-light">This div has a light grey border.</div>+ * <div class="border-nc-border-gray-light">This div has a light gray border.</div>* ```** ###### Background Colordiff --git a/packages/nc-gui/windi.config.ts b/packages/nc-gui/windi.config.tsindex 562437a315..f04c39506c 100644--- a/packages/nc-gui/windi.config.ts+++ b/packages/nc-gui/windi.config.ts@@ -11,7 +11,14 @@ import animations from '@windicss/plugin-animations'// @ts-expect-error no types for plugin-question-markimport questionMark from '@windicss/plugin-question-mark'-import { theme as colors, themeColors, themeV2Colors, themeV3Colors, themeVariables } from './utils/colorsUtils'+import {+ theme as colors,+ themeColors,+ themeV2Colors,+ themeV3Colors,+ themeV4ColorsWithNcPrefix,+ themeVariables,+} from './utils/colorsUtils'const isEE = process.env.EE@@ -187,6 +194,7 @@ export default defineConfig({...themeColors,...themeV2Colors,...themeV3Colors,+ ...themeV4ColorsWithNcPrefix,...themeVariables.content,...themeVariables.border,...themeVariables.background,