From 4f2378ff023b08213adfd16a08608dd962600c51 Mon Sep 17 00:00:00 2001 From: dpschen Date: Fri, 24 Sep 2021 18:08:48 +0000 Subject: [PATCH] feat: add variant hint-modal to modal component (#764) Co-authored-by: Dominik Pschenitschni Co-authored-by: kolaente Reviewed-on: https://kolaente.dev/vikunja/frontend/pulls/764 Reviewed-by: konrad Co-authored-by: dpschen Co-committed-by: dpschen --- src/components/misc/keyboard-shortcuts.vue | 10 +- src/components/misc/shortcut.vue | 23 ++- src/components/modal/modal.vue | 171 +++++++++++++++++- .../quick-actions/quick-actions.vue | 17 ++ .../tasks/partials/quick-add-magic.vue | 16 +- src/styles/components/_all.scss | 2 - src/styles/components/hint-modal.scss | 43 ----- src/styles/components/kanban.scss | 2 - src/styles/components/modal.scss | 83 --------- src/styles/components/quick-actions.scss | 6 - src/styles/theme/navigation.scss | 2 - src/styles/theme/variables-derived.scss | 2 - src/styles/variables/_index.scss | 6 + src/views/About.vue | 22 +-- src/views/filters/CreateSavedFilter.vue | 16 +- src/views/tasks/TaskDetailViewModal.vue | 30 +-- vite.config.js | 8 +- 17 files changed, 258 insertions(+), 201 deletions(-) delete mode 100644 src/styles/components/hint-modal.scss delete mode 100644 src/styles/components/modal.scss create mode 100644 src/styles/variables/_index.scss diff --git a/src/components/misc/keyboard-shortcuts.vue b/src/components/misc/keyboard-shortcuts.vue index f0c9a5dfa..10ac3c0cd 100644 --- a/src/components/misc/keyboard-shortcuts.vue +++ b/src/components/misc/keyboard-shortcuts.vue @@ -1,7 +1,5 @@ + \ No newline at end of file diff --git a/src/components/misc/shortcut.vue b/src/components/misc/shortcut.vue index 8ec894f27..47b617fbf 100644 --- a/src/components/misc/shortcut.vue +++ b/src/components/misc/shortcut.vue @@ -1,8 +1,8 @@ @@ -18,3 +18,22 @@ export default { }, } + + \ No newline at end of file diff --git a/src/components/modal/modal.vue b/src/components/modal/modal.vue index d544183de..020e33b2b 100644 --- a/src/components/modal/modal.vue +++ b/src/components/modal/modal.vue @@ -1,13 +1,27 @@ + + \ No newline at end of file diff --git a/src/components/quick-actions/quick-actions.vue b/src/components/quick-actions/quick-actions.vue index dbf002a49..5510004b7 100644 --- a/src/components/quick-actions/quick-actions.vue +++ b/src/components/quick-actions/quick-actions.vue @@ -485,3 +485,20 @@ export default { }, } + + diff --git a/src/components/tasks/partials/quick-add-magic.vue b/src/components/tasks/partials/quick-add-magic.vue index 402ee169a..e6d6061aa 100644 --- a/src/components/tasks/partials/quick-add-magic.vue +++ b/src/components/tasks/partials/quick-add-magic.vue @@ -4,10 +4,13 @@ {{ $t('task.quickAddMagic.hint') }}. {{ $t('task.quickAddMagic.what') }}

- - - + diff --git a/src/styles/components/_all.scss b/src/styles/components/_all.scss index 5895a11fe..2b4c19f45 100644 --- a/src/styles/components/_all.scss +++ b/src/styles/components/_all.scss @@ -14,7 +14,6 @@ @import 'comments'; @import 'table-view'; @import 'kanban'; -@import 'modal'; @import 'list-backgrounds'; @import 'color-picker'; @import 'namespaces'; @@ -24,4 +23,3 @@ @import 'datepicker'; @import 'notifications'; @import 'quick-actions'; -@import 'hint-modal'; diff --git a/src/styles/components/hint-modal.scss b/src/styles/components/hint-modal.scss deleted file mode 100644 index e82b32d28..000000000 --- a/src/styles/components/hint-modal.scss +++ /dev/null @@ -1,43 +0,0 @@ -.hint-modal { - z-index: 4600; - - .card-content { - text-align: left; - - .info { - font-style: italic; - } - - p { - display: flex; - justify-content: space-between; - align-items: center; - - .shortcuts { - display: flex; - align-items: center; - - i { - padding: 0 .25rem; - } - - span { - padding: .1rem .35rem; - border: 1px solid $grey-300; - background: $grey-100; - border-radius: 3px; - font-size: .75rem; - } - } - } - - .message-body { - padding: .5rem .75rem; - } - } -} - -.modal-container-smaller .hint-modal .modal-container { - height: calc(100vh - 5rem); -} - diff --git a/src/styles/components/kanban.scss b/src/styles/components/kanban.scss index 9a702f9be..3b96b6c15 100644 --- a/src/styles/components/kanban.scss +++ b/src/styles/components/kanban.scss @@ -1,5 +1,3 @@ -@use 'sass:math'; - $bucket-background: $grey-100; $task-background: $white; $ease-out: all .3s cubic-bezier(0.23, 1, 0.32, 1); diff --git a/src/styles/components/modal.scss b/src/styles/components/modal.scss deleted file mode 100644 index 5719f5741..000000000 --- a/src/styles/components/modal.scss +++ /dev/null @@ -1,83 +0,0 @@ -.modal-mask { - position: fixed; - z-index: 4000; - top: 0; - left: 0; - width: 100%; - height: 100%; - background-color: rgba(0, 0, 0, .8); - transition: opacity 150ms ease; - color: #fff; - - .modal-container { - transition: all 150ms ease; - position: relative; - width: 100%; - height: 100%; - max-height: 100vh; - overflow: auto; - - .scrolling-content { - max-width: 1024px; - width: 100%; - margin: 4rem auto; - - @media screen and (max-width: $desktop) { - margin: 0; - - .close { - display: none; - } - } - } - - .modal-content { - text-align: center; - position: absolute; - top: 50%; - left: 50%; - transform: translate(-50%, -50%); - text-align: center; - - @media screen and (max-width: $tablet) { - margin: 0; - top: 25%; - transform: translate(-50%, -25%); - } - - .header { - font-size: 2rem; - font-weight: 700; - } - - .button { - margin: 0 0.5rem; - } - } - - .close { - position: fixed; - top: 5px; - right: 26px; - color: $white; - font-size: 2rem; - } - - .is-wide { - max-width: $desktop; - width: calc(100% - 2rem); - } - } -} - -/* Transitions */ - -.modal-enter, -.modal-leave-active { - opacity: 0; -} - -.modal-enter .modal-container, -.modal-leave-active .modal-container { - transform: scale(0.9); -} diff --git a/src/styles/components/quick-actions.scss b/src/styles/components/quick-actions.scss index 71583e9af..c6e6e603e 100644 --- a/src/styles/components/quick-actions.scss +++ b/src/styles/components/quick-actions.scss @@ -1,10 +1,4 @@ .quick-actions { - - .modal-content { - top: 6rem !important; - transform: translate(-50%, -3rem) !important; - } - .action-input { display: flex; align-items: center; diff --git a/src/styles/theme/navigation.scss b/src/styles/theme/navigation.scss index a06d0a894..1e06b22ab 100644 --- a/src/styles/theme/navigation.scss +++ b/src/styles/theme/navigation.scss @@ -1,5 +1,3 @@ -@use "sass:math"; - .navbar { z-index: 4 !important; diff --git a/src/styles/theme/variables-derived.scss b/src/styles/theme/variables-derived.scss index 4d98e8476..ee5c640f1 100644 --- a/src/styles/theme/variables-derived.scss +++ b/src/styles/theme/variables-derived.scss @@ -1,4 +1,2 @@ -@use "sass:math"; - // Variables that are derived from bulma variables need to be included after them $mobile: math.div($tablet, 2); diff --git a/src/styles/variables/_index.scss b/src/styles/variables/_index.scss new file mode 100644 index 000000000..ba1a82473 --- /dev/null +++ b/src/styles/variables/_index.scss @@ -0,0 +1,6 @@ +@import "colors"; +@import "shadows"; +@import "variables"; + +// the default values get overwritten by the definitions above +@import "bulma/sass/utilities/_all"; \ No newline at end of file diff --git a/src/views/About.vue b/src/views/About.vue index 331b9e21e..5ca41da34 100644 --- a/src/views/About.vue +++ b/src/views/About.vue @@ -1,14 +1,10 @@ + + \ No newline at end of file diff --git a/vite.config.js b/vite.config.js index 459f494dd..5a7f15d00 100644 --- a/vite.config.js +++ b/vite.config.js @@ -5,12 +5,14 @@ const {visualizer} = require('rollup-plugin-visualizer') const pathSrc = path.resolve(__dirname, './src') +// the @use rules have to be the first in the compiled stylesheets +const SCSS_IMPORT_PREFIX = `@use "sass:math"; +@import "${pathSrc}/styles/variables";` + module.exports = { css: { preprocessorOptions: { - scss: { - additionalData: `@import "${pathSrc}/styles/variables/_all.scss";`, - }, + scss: { additionalData: SCSS_IMPORT_PREFIX }, }, }, plugins: [