From 46fa43d67f04811f7e5029c58433a0b33539535b Mon Sep 17 00:00:00 2001 From: adrinux Date: Mon, 22 Nov 2021 21:12:54 +0000 Subject: [PATCH] Migrate to bulma-css-variables and introduce dark mode (#954) Co-authored-by: Adrian Simmons Co-authored-by: Dominik Pschenitschni Co-authored-by: kolaente Reviewed-on: https://kolaente.dev/vikunja/frontend/pulls/954 Reviewed-by: dpschen Reviewed-by: konrad Co-authored-by: adrinux Co-committed-by: adrinux --- package.json | 3 +- src/App.vue | 4 + src/assets/logo-full-pride.svg | 2 +- src/assets/logo-full.svg | 2 +- src/components/home/Logo.vue | 10 +- src/components/home/MenuButton.vue | 4 +- src/components/home/PoweredByLink.vue | 2 +- src/components/home/contentAuth.vue | 8 +- src/components/home/contentLinkShare.vue | 4 +- src/components/home/navigation.vue | 22 ++-- src/components/home/topNavigation.vue | 15 ++- src/components/home/update.vue | 2 +- src/components/input/button.vue | 8 +- src/components/input/colorPicker.vue | 2 +- src/components/input/datepicker.vue | 8 +- src/components/input/editor.vue | 9 +- src/components/input/fancycheckbox.vue | 4 +- src/components/input/multiselect.vue | 26 ++-- src/components/list/partials/list-card.vue | 20 +-- src/components/misc/Done.vue | 4 +- src/components/misc/api-config.vue | 2 +- src/components/misc/card.vue | 10 +- src/components/misc/legal.vue | 2 +- src/components/misc/no-auth-wrapper.vue | 4 +- src/components/misc/ready.vue | 6 +- src/components/misc/shortcut.vue | 4 +- .../notifications/notifications.vue | 18 +-- .../quick-actions/quick-actions.vue | 9 +- src/components/tasks/edit-task.vue | 2 +- src/components/tasks/gantt-component.vue | 30 ++--- src/components/tasks/partials/attachments.vue | 14 +- .../tasks/partials/checklist-summary.vue | 6 +- src/components/tasks/partials/defer-task.vue | 8 +- .../tasks/partials/editAssignees.vue | 6 +- src/components/tasks/partials/kanban-card.vue | 18 +-- src/components/tasks/partials/listSearch.vue | 2 +- .../tasks/partials/priorityLabel.vue | 4 +- .../tasks/partials/relatedTasks.vue | 10 +- src/components/tasks/partials/reminders.vue | 4 +- .../tasks/partials/singleTaskInList.vue | 24 ++-- src/composables/useColorScheme.ts | 48 +++++++ src/i18n/lang/en.json | 9 ++ src/styles/common-imports.scss | 44 +++++++ src/styles/components/labels.scss | 2 +- src/styles/components/task.scss | 4 +- src/styles/components/tooltip.scss | 4 +- src/styles/custom-properties/_index.scss | 2 + src/styles/custom-properties/colors.scss | 122 ++++++++++++++++++ src/styles/custom-properties/shadows.scss | 22 ++++ src/styles/fonts.scss | 14 +- src/styles/global.scss | 18 +-- src/styles/theme/background.scss | 2 +- src/styles/theme/content.scss | 2 +- src/styles/theme/scrollbars.scss | 6 +- src/styles/theme/theme.scss | 18 +-- src/styles/variables/_index.scss | 12 -- src/styles/variables/colors.scss | 18 --- src/styles/variables/shadows.scss | 5 - src/styles/variables/variables.scss | 41 ------ src/views/list/ShowList.vue | 14 +- src/views/list/settings/background.vue | 4 +- src/views/list/views/Kanban.vue | 11 +- src/views/list/views/List.vue | 4 +- src/views/migrator/MigrateService.vue | 6 +- src/views/namespaces/ListNamespaces.vue | 4 +- src/views/tasks/TaskDetailView.vue | 48 ++++--- src/views/tasks/TaskDetailViewModal.vue | 12 +- src/views/teams/ListTeams.vue | 2 +- src/views/user/Settings.vue | 6 +- src/views/user/settings/Avatar.vue | 2 +- src/views/user/settings/General.vue | 48 +++++++ vite.config.js | 9 +- yarn.lock | 28 +++- 73 files changed, 605 insertions(+), 328 deletions(-) create mode 100644 src/composables/useColorScheme.ts create mode 100644 src/styles/common-imports.scss create mode 100644 src/styles/custom-properties/_index.scss create mode 100644 src/styles/custom-properties/colors.scss create mode 100644 src/styles/custom-properties/shadows.scss delete mode 100644 src/styles/variables/_index.scss delete mode 100644 src/styles/variables/colors.scss delete mode 100644 src/styles/variables/shadows.scss delete mode 100644 src/styles/variables/variables.scss diff --git a/package.json b/package.json index c4bbe325..e2a26cc1 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,8 @@ "@sentry/tracing": "6.15.0", "@sentry/vue": "6.15.0", "@vue/compat": "3.2.22", - "bulma": "0.9.3", + "@vueuse/core": "^6.8.0", + "bulma-css-variables": "^0.9.33", "camel-case": "4.1.2", "codemirror": "5.64.0", "copy-to-clipboard": "3.3.1", diff --git a/src/App.vue b/src/App.vue index af2fc690..5eacb532 100644 --- a/src/App.vue +++ b/src/App.vue @@ -33,6 +33,7 @@ import ContentNoAuth from './components/home/contentNoAuth' import {setLanguage} from './i18n' import AccountDeleteService from '@/services/accountDelete' import Ready from '@/components/misc/ready' +import {useColorScheme} from '@/composables/useColorScheme' export default defineComponent({ name: 'app', @@ -54,6 +55,9 @@ export default defineComponent({ beforeCreate() { setLanguage() }, + setup() { + useColorScheme() + }, created() { // Make sure to always load the home route when running with electron if (this.$route.fullPath.endsWith('frontend/index.html')) { diff --git a/src/assets/logo-full-pride.svg b/src/assets/logo-full-pride.svg index f7d6527f..1ecacb3e 100644 --- a/src/assets/logo-full-pride.svg +++ b/src/assets/logo-full-pride.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/assets/logo-full.svg b/src/assets/logo-full.svg index c5e728a3..20b6ae13 100644 --- a/src/assets/logo-full.svg +++ b/src/assets/logo-full.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/components/home/Logo.vue b/src/components/home/Logo.vue index cea2d0f0..5a5612b4 100644 --- a/src/components/home/Logo.vue +++ b/src/components/home/Logo.vue @@ -7,5 +7,11 @@ const Logo = computed(() => new Date().getMonth() === 5 ? LogoFullPride : LogoFu \ No newline at end of file +