Skip to content

πŸ”₯ πŸ”₯ πŸ”₯ A Free & Self-hostable Airtable Alternative

fix(nc-gui): update nc table button list component

Ramesh Mane93858aa1b7b8
diff --git a/packages/nc-gui/assets/css/global.css b/packages/nc-gui/assets/css/global.css
index a02eca39d0..11946cc78d 100644
--- a/packages/nc-gui/assets/css/global.css
+++ b/packages/nc-gui/assets/css/global.css
@@ -18,10 +18,6 @@ body,
sans-serif;
}
-body{
- background-color: var(--color-bg);
-}
-
/*
Apply Inter for rtl
*/
diff --git a/packages/nc-gui/assets/css/theme-overrides.scss b/packages/nc-gui/assets/css/theme-overrides.scss
index 8e84ad1474..ea4d042458 100644
--- a/packages/nc-gui/assets/css/theme-overrides.scss
+++ b/packages/nc-gui/assets/css/theme-overrides.scss
@@ -1,13 +1,46 @@
+body {
+ @apply bg-nc-bg-default text-[var(--color-text)];
+}
+
.ant-layout-content {
@apply !bg-nc-bg-default;
}
// Dropdown
.ant-dropdown {
- @apply !bg-nc-bg-default;
+ @apply !bg-nc-bg-default !text-nc-content-gray;
}
// Dropdown Menu
.ant-dropdown-menu.ant-dropdown-menu-root {
- @apply !bg-nc-bg-default;
+ @apply !bg-nc-bg-default !text-nc-content-gray;
+
+ .ant-dropdown-menu-item {
+ &:not(.ant-dropdown-menu-item-disabled) {
+ @apply hover:text-nc-content-gray-extreme text-nc-content-gray-subtle;
+ }
+ }
+}
+
+// Dark theme specific style
+[theme='dark'] {
+ // Divider
+ .ant-divider {
+ @apply border-nc-border-gray-light;
+ }
+
+ // Dropdown Menu
+ .ant-dropdown-menu.ant-dropdown-menu-root {
+ .ant-dropdown-menu-item {
+ @apply hover:bg-nc-bg-gray-light;
+
+ &:not(.ant-dropdown-menu-item-disabled) {
+ @apply hover:text-nc-content-gray-extreme text-nc-content-gray;
+ }
+ }
+
+ .ant-dropdown-menu-submenu-title {
+ @apply hover:bg-nc-bg-gray-light;
+ }
+ }
}
diff --git a/packages/nc-gui/components/nc/Button.vue b/packages/nc-gui/components/nc/Button.vue
index 8cf7fc7a76..83acd708a6 100644
--- a/packages/nc-gui/components/nc/Button.vue
+++ b/packages/nc-gui/components/nc/Button.vue
@@ -187,7 +187,7 @@ useEventListener(NcButton, 'mousedown', () => {
.nc-button.ant-btn-text.focused {
&.theme-default {
- @apply text-brand-500;
+ @apply text-nc-content-brand;
}
&.theme-ai {
@@ -230,11 +230,11 @@ useEventListener(NcButton, 'mousedown', () => {
@apply border-0 !cursor-not-allowed;
&.theme-default {
- @apply bg-gray-50 text-gray-300 md:(hover:bg-gray-50);
+ @apply bg-nc-bg-gray-extralight text-nc-content-brand-hover md:(hover:bg-nc-bg-gray-extralight);
}
&.theme-ai {
- @apply bg-purple-50 text-purple-300 md:(hover:bg-purple-50);
+ @apply bg-nc-bg-purple-light text-nc-content-purple-light md:(hover:bg-nc-bg-purple-light);
}
}
@@ -245,11 +245,11 @@ useEventListener(NcButton, 'mousedown', () => {
@apply border-0;
&.theme-default {
- @apply bg-gray-50 text-gray-300 md:(hover:bg-gray-50);
+ @apply bg-nc-bg-gray-extralight text-nc-content-brand-hover md:(hover:bg-nc-bg-gray-extralight);
}
&.theme-ai {
- @apply bg-purple-50 text-purple-300 md:(hover:bg-purple-50);
+ @apply bg-nc-bg-purple-light text-nc-content-purple-light md:(hover:bg-nc-bg-purple-light);
}
}
@@ -270,15 +270,15 @@ useEventListener(NcButton, 'mousedown', () => {
}
&.theme-default {
- @apply bg-white hover:bg-white border-gray-100 text-gray-300;
+ @apply bg-nc-bg-default hover:bg-nc-bg-default border-nc-border-gray-light text-nc-content-brand-hover;
&.bordered {
- @apply border-gray-100;
+ @apply border-nc-border-gray-light;
}
}
&.theme-ai {
- @apply bg-purple-50 hover:bg-purple-50 text-purple-300;
+ @apply bg-nc-bg-purple-light hover:bg-nc-bg-purple-light text-nc-content-purple-light;
&.bordered {
@apply border-purple-100;
@@ -294,7 +294,7 @@ useEventListener(NcButton, 'mousedown', () => {
}
&.theme-ai {
- @apply bg-purple-700 md:(hover:bg-purple-800);
+ @apply bg-nc-bg-purple-dark md:(hover:bg-nc-bg-purple-dark);
}
}
@@ -306,15 +306,15 @@ useEventListener(NcButton, 'mousedown', () => {
}
&.theme-default {
- @apply bg-white text-gray-700 md:(hover:bg-gray-100);
+ @apply bg-nc-bg-default text-nc-content-inverted-secondary md:(hover:bg-nc-bg-gray-light);
&.bordered {
- @apply border-gray-200;
+ @apply border-nc-border-gray-medium;
}
}
&.theme-ai {
- @apply bg-purple-50 text-purple-700 md:(hover:bg-purple-100);
+ @apply bg-nc-bg-purple-light text-nc-content-purple-dark md:(hover:bg-nc-bg-purple-dark);
&.bordered {
@apply border-purple-200;
@@ -332,7 +332,7 @@ useEventListener(NcButton, 'mousedown', () => {
@apply bg-transparent border-0;
&.theme-default {
- @apply text-gray-700 hover:text-gray-900 hover:bg-gray-100;
+ @apply text-nc-content-inverted-secondary hover:text-nc-content-gray-emphasis hover:bg-nc-bg-gray-light;
}
&.theme-ai {
diff --git a/packages/nc-gui/components/nc/List/index.vue b/packages/nc-gui/components/nc/List/index.vue
index 9932250eea..893ced9f4d 100644
--- a/packages/nc-gui/components/nc/List/index.vue
+++ b/packages/nc-gui/components/nc/List/index.vue
@@ -405,11 +405,11 @@ defineExpose({
{
'rounded-md': !itemFullWidth,
'nc-list-option-selected': compareVModel(option[optionValueKey]),
- 'bg-gray-100 ':
+ 'bg-nc-bg-gray-light ':
!option?.ncItemDisabled && showHoverEffectOnSelectedOption && compareVModel(option[optionValueKey]),
- 'bg-gray-100 nc-list-option-active': !option?.ncItemDisabled && activeOptionIndex === idx,
+ 'bg-nc-bg-gray-light nc-list-option-active': !option?.ncItemDisabled && activeOptionIndex === idx,
'opacity-60 cursor-not-allowed': option?.ncItemDisabled,
- 'hover:bg-gray-100 cursor-pointer': !option?.ncItemDisabled,
+ 'hover:bg-nc-bg-gray-light cursor-pointer': !option?.ncItemDisabled,
'py-2': variant === 'default',
'py-[5px]': variant === 'medium',
'py-[3px]': variant === 'small',
@@ -503,7 +503,7 @@ defineExpose({
:deep(.nc-toolbar-dropdown-search-field-input) {
&.ant-input-affix-wrapper-focused {
.ant-input-prefix svg {
- @apply text-brand-500;
+ @apply text-nc-content-brand;
}
}
.ant-input {
diff --git a/packages/nc-gui/components/nc/Table.vue b/packages/nc-gui/components/nc/Table.vue
index 8e3eddf9ae..b2f03654e4 100644
--- a/packages/nc-gui/components/nc/Table.vue
+++ b/packages/nc-gui/components/nc/Table.vue
@@ -225,7 +225,7 @@ watch(
:class="[
tableToolbarClassName,
{
- 'sticky z-5 top-0 bg-white': forceStickyHeader,
+ 'sticky z-5 top-0 bg-nc-bg-default': forceStickyHeader,
},
]"
>
diff --git a/packages/nc-gui/migrate-colors.js b/packages/nc-gui/migrate-colors.js
index 7dce15311c..f9dd0d8020 100644
--- a/packages/nc-gui/migrate-colors.js
+++ b/packages/nc-gui/migrate-colors.js
@@ -1,6 +1,14 @@
const fs = require('fs')
const glob = require('glob')
+/**
+ * @example
+ * ```zsh
+ * cd packages/nc-gui
+ * node migrate-colors.js convert ./components/dlg/
+ * ```
+ */
+
// Define conflict resolution strategies
const CONFLICT_STRATEGIES = {
ASK_USER: 'ask_user',