Skip to content

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

fix: invert shared view ask password modal background colors in dark mode

Ramesh Manee0bfd0022739
diff --git a/packages/nc-gui/components/shared-view/AskPassword.vue b/packages/nc-gui/components/shared-view/AskPassword.vue
index cf88615266..cdf0cc50da 100644
--- a/packages/nc-gui/components/shared-view/AskPassword.vue
+++ b/packages/nc-gui/components/shared-view/AskPassword.vue
@@ -20,6 +20,8 @@ const route = useRoute()
const { loadSharedView } = useSharedView()
+const { isDark } = useTheme()
+
const formState = ref({ password: undefined })
const passwordError = ref<string | null>(null)
@@ -68,7 +70,7 @@ const bgImageName = computed(() => {
:class="{ active: vModel }"
:mask-closable="false"
:mask-style="{
- backgroundColor: 'rgba(255, 255, 255, 0.64)',
+ backgroundColor: 'rgba(var(--color-base-white), 0.64)',
backdropFilter: 'blur(8px)',
}"
>
@@ -114,5 +116,11 @@ const bgImageName = computed(() => {
</div>
</NcModal>
- <img alt="view image" :src="bgImageName" class="fixed inset-0 w-full h-full" />
+ <img alt="view image" :src="bgImageName" class="fixed inset-0 w-full h-full" :class="{ 'bg-view-image--dark': isDark }" />
</template>
+
+<style lang="scss" scoped>
+.bg-view-image--dark {
+ filter: invert(1) hue-rotate(180deg);
+}
+</style>
diff --git a/packages/nc-gui/pages/index/[typeOrId]/form/[viewId].vue b/packages/nc-gui/pages/index/[typeOrId]/form/[viewId].vue
index 2a1e648caf..6d56ff41d5 100644
--- a/packages/nc-gui/pages/index/[typeOrId]/form/[viewId].vue
+++ b/packages/nc-gui/pages/index/[typeOrId]/form/[viewId].vue
@@ -12,6 +12,8 @@ useSidebar('nc-left-sidebar', { hasSidebar: false })
const route = useRoute()
+const { isDark } = useTheme()
+
const { loadSharedView, sharedView, sharedViewMeta, meta, notFound, password, passwordDlg, passwordError } =
useProvideSharedFormStore(route.params.viewId as string)
@@ -67,7 +69,7 @@ const focus: VNodeRef = (el: typeof InputPassword) => {
:mask-closable="false"
wrap-class-name="nc-modal-shared-form-password-dlg"
:mask-style="{
- backgroundColor: 'rgba(255, 255, 255, 0.64)',
+ backgroundColor: 'rgba(var(--color-base-white), 0.64)',
backdropFilter: 'blur(8px)',
}"
@close="passwordDlg = false"
@@ -112,12 +114,22 @@ const focus: VNodeRef = (el: typeof InputPassword) => {
</div>
</a-modal>
- <img v-if="passwordDlg" alt="view image" src="~/assets/img/views/form.png" class="fixed inset-0 w-full h-full" />
+ <img
+ v-if="passwordDlg"
+ alt="view image"
+ src="~/assets/img/views/form.png"
+ class="fixed inset-0 w-full h-full"
+ :class="{ 'bg-view-image--dark': isDark }"
+ />
</NuxtLayout>
</div>
</template>
<style lang="scss" scoped>
+.bg-view-image--dark {
+ filter: invert(1) hue-rotate(180deg);
+}
+
:deep(.nc-cell-attachment) {
@apply p-0;