π The open-source, offline-first Notion, Obsidian & Confluence alternative. Advanced Markdown, multi-tenant teams, OIDC/SSO, and local S3 backups. Deploy in one command.
Vue dockergolangkanbanknowledge-baseknowledge-managementmarkdownnote-takingnotesnotes-appnotionnuxtnuxtjsoffline-firstoidcpwaselfhostedssovuevuejswiki
Color fixes
Smaug673991fcfc1955c7
diff --git a/frontend/app/components/AppColorPicker.vue b/frontend/app/components/AppColorPicker.vueindex fbe5a07e..a01e25a8 100644--- a/frontend/app/components/AppColorPicker.vue+++ b/frontend/app/components/AppColorPicker.vue@@ -1,7 +1,14 @@<template><div class="color-picker"><div- v-for="(_, index) in AppColors"+ class="color-option"+ style="background-color: white; border: 1px solid var(--border-color)"+ :style="{ outline: selectedColor == -1 ? '2px solid var(--font-color-light)' : '' }"+ :class="{ selected: selectedColor === -1 }"+ @click="selectColor(-1)"+ ></div>+ <div+ v-for="(_, index) in appColors":key="index"class="color-option":style="{ backgroundColor: getAppColor(index) ? `var(--${getAppColor(index)})` : '#fff', border: '1px solid var(--border-color)', outline: selectedColor === index ? `2px solid var(--${getAppColor(index)})` : 'none' }"@@ -12,10 +19,10 @@</template><script setup lang="ts">-const props = defineProps<{ selectedColor?: number | null }>();+const props = defineProps<{ selectedColor?: number | null; nullable?: boolean }>();const emit = defineEmits<{ (e: 'update:selectedColor', color: number): void }>();-const selectedColor = ref<number | null | undefined>(props.selectedColor);+const selectedColor = ref<number | null | undefined>(props.selectedColor || -1);function selectColor(color: number) {selectedColor.value = color;diff --git a/frontend/app/components/AppSelect.vue b/frontend/app/components/AppSelect.vueindex 6516e4cf..49641865 100644--- a/frontend/app/components/AppSelect.vue+++ b/frontend/app/components/AppSelect.vue@@ -113,7 +113,7 @@ button,padding: 8px;border: 1px solid var(--border-color);text-align: left;- border-radius: 8px;+ border-radius: 6px;font-size: 15px;cursor: pointer;&:focus {diff --git a/frontend/app/components/DocumentCard.vue b/frontend/app/components/DocumentCard.vueindex 82c06ebd..9f63816e 100644--- a/frontend/app/components/DocumentCard.vue+++ b/frontend/app/components/DocumentCard.vue@@ -3,7 +3,7 @@<div class="top"><div class="header"><span style="display: flex">- <Icon :name="category?.icon || 'files'" :class="`category-icon ${getAppColor(category?.color as number) || 'primary'}`" /> <NuxtLink :to="`/dashboard/docs/${document.id}`" class="document-title">{{ document.name }}</NuxtLink>+ <Icon :name="category?.icon || 'files'" :class="`category-icon ${getAppColor(category?.color as number)}`" /> <NuxtLink :to="`/dashboard/docs/${document.id}`" class="document-title">{{ document.name }}</NuxtLink></span><DocumentDotMenu :document="document" :user="user" /></div>diff --git a/frontend/app/composables/utils.ts b/frontend/app/composables/utils.tsindex a0f8ef38..1c043044 100644--- a/frontend/app/composables/utils.ts+++ b/frontend/app/composables/utils.ts@@ -1,4 +1,4 @@-import type { User } from '../../stores/db_strustures';+import type { User } from '@/stores/db_strustures';export const CDN = import.meta.env.VITE_BASE_CDN;export const API = `${import.meta.env.VITE_BASE_API}/api`;@@ -12,9 +12,10 @@ export function useAvatar(user?: User): string {return user?.avatar ? CDN + '/' + user.id + '/avatar' : CDN + '/default_avatar.png';}-export const AppColors = ['', 'blue', 'red', 'green', 'yellow', 'purple', 'pink', 'teal', 'grey'];+export const appColors = ['default', 'blue', 'red', 'green', 'yellow', 'purple', 'pink', 'teal', 'grey'];export function getAppColor(index: number = 0): string {- return AppColors[index % AppColors.length] || '';+ if (!index) return 'primary';+ return appColors[index % appColors.length] || 'primary';}export const readableFileSize = (size: number): string => {@@ -38,9 +39,9 @@ export function debounce(fn: Function, wait: number) {export function setAppColor(color: string | number) {if (typeof color === 'number') {- if (color == 0) return;color = getAppColor(color);}+ if (color === 'primary') color = 'default';document.documentElement.style.setProperty('--primary', `var(--${color})`);document.documentElement.style.setProperty('--primary-bg', `var(--${color}-bg)`);document.documentElement.style.setProperty('--primary-border', `var(--${color}-border)`);diff --git a/frontend/app/pages/dashboard/categories/_modals/CreateCategoryModal.vue b/frontend/app/pages/dashboard/categories/_modals/CreateCategoryModal.vueindex 991b11a2..f4824c0b 100644--- a/frontend/app/pages/dashboard/categories/_modals/CreateCategoryModal.vue+++ b/frontend/app/pages/dashboard/categories/_modals/CreateCategoryModal.vue@@ -54,6 +54,6 @@ label {margin: 5px 0;}.entry {- background: var(--bg-contrast-2);+ background: var(--bg-color);}</style>diff --git a/frontend/app/styles/_variables.scss b/frontend/app/styles/_variables.scssindex ac9bc611..aa1f9ac9 100644--- a/frontend/app/styles/_variables.scss+++ b/frontend/app/styles/_variables.scss@@ -36,9 +36,10 @@ $primary-dark: color.adjust(#6024ec, $lightness: -10%);- --primary: #3956e7;- --primary-bg: #dde1f8;- --primary-border: #dde1f8;+ --default: #3956e7;+ --default-bg: #dde1f8;+ --default-border: #dde1f8;+--bg-soft: #fafafa;--bg-color: #fcfcfc;--bg-contrast: #f3f3f5;