diff --git a/docs/presentation.md b/docs/presentation.md index 1ab29b41..85180c75 100644 --- a/docs/presentation.md +++ b/docs/presentation.md @@ -79,14 +79,15 @@ To add a new dependency: ## Shared UI components -Shared UI components promote consistency and simplifies the creation of the front-end. +Shared UI components ensure consistency and streamline front-end development. -In order to maintain portability and easy maintainability, the preference is towards using homegrown components over third-party ones or comprehensive UI frameworks like Quasar. +We use homegrown components over third-party solutions or comprehensive UI frameworks like Quasar to maintain portability and easy maintenance. Shared components include: -- [ModalDialog.vue](./../src/presentation/components/Shared/Modal/ModalDialog.vue) is utilized for rendering modal windows. -- [TooltipWrapper.vue](./../src/presentation/components/Shared/TooltipWrapper.vue) acts as a wrapper for rendering tooltips. +- [ModalDialog.vue](./../src/presentation/components/Shared/Modal/ModalDialog.vue): Renders modal windows. +- [TooltipWrapper.vue](./../src/presentation/components/Shared/TooltipWrapper.vue): Provides tooltip functionality for improved information accessibility. +- [FlatButton.vue](./../src/presentation/components/Shared/FlatButton.vue): Creates flat-style buttons for a unified and consistent user interface. ## Desktop builds diff --git a/src/presentation/assets/styles/_colors.scss b/src/presentation/assets/styles/_colors.scss index b5434895..3b164b3f 100644 --- a/src/presentation/assets/styles/_colors.scss +++ b/src/presentation/assets/styles/_colors.scss @@ -30,7 +30,6 @@ $color-on-surface : #4d5156; // Background | Appears behind scrollable content. $color-background : #e6ecf4; - /* Application-specific colors: These are tailored to the specific needs of the application and derived from the above theme colors. @@ -38,3 +37,4 @@ $color-background : #e6ecf4; This approach maintains a cohesive look and feel and simplifies theme adjustments. */ $color-scripts-bg: $color-primary-darker; +$color-highlight: $color-primary; diff --git a/src/presentation/assets/styles/_globals.scss b/src/presentation/assets/styles/_globals.scss index 6e1b60bf..f88ea946 100644 --- a/src/presentation/assets/styles/_globals.scss +++ b/src/presentation/assets/styles/_globals.scss @@ -11,14 +11,10 @@ box-sizing: border-box; } -$globals-color-hover: $color-primary; a { - color:inherit; - text-decoration: underline; + color: inherit; cursor: pointer; - @include hover-or-touch { - color: $globals-color-hover; - } + @include flat-button($disabled: false); } body { diff --git a/src/presentation/assets/styles/_mixins.scss b/src/presentation/assets/styles/_mixins.scss index b4695dbf..135e6768 100644 --- a/src/presentation/assets/styles/_mixins.scss +++ b/src/presentation/assets/styles/_mixins.scss @@ -1,3 +1,5 @@ +@use "@/presentation/assets/styles/colors" as *; + @mixin hover-or-touch($selector-suffix: '', $selector-prefix: '&') { @media (hover: hover) { /* @@ -65,3 +67,47 @@ padding: 0; list-style: none; } + +@mixin reset-button { + margin: 0; + padding-block: 0; + padding-inline: 0; + font: unset; + border: unset; + background: unset; + align-items: unset; + text-align: unset; + text-shadow: unset; + text-rendering: unset; + color: inherit; + writing-mode: unset; + letter-spacing: unset; + word-spacing: unset; + line-height: unset; + text-transform: unset; + text-indent: unset; + appearance: unset; + cursor: unset; +} + +@mixin flat-button($disabled: false) { + @include reset-button; + + @if $disabled { + color: $color-primary-light; + } @else { + color: inherit; + @include clickable; + @include hover-or-touch { + text-decoration: underline; + color: $color-highlight; + /* + Using color change and underlining and as hover cues instead of bold text, + due to inconsistent bold rendering in macOS browsers: + - Safari: Renders bold, causes layout shift. + - Firefox: Renders bold correctly, no layout shift. + - Chromium-based browsers (including Electron app): Do not render bold, no layout shift. + */ + } + } +} diff --git a/src/presentation/components/Code/CodeButtons/IconButton.vue b/src/presentation/components/Code/CodeButtons/IconButton.vue index a8a9cc93..d0978312 100644 --- a/src/presentation/components/Code/CodeButtons/IconButton.vue +++ b/src/presentation/components/Code/CodeButtons/IconButton.vue @@ -64,6 +64,8 @@ export default defineComponent({ } .button { + @include reset-button; + display: flex; align-items: center; justify-content: center; @@ -72,13 +74,13 @@ export default defineComponent({ color: $color-on-secondary; border: none; - padding:20px; + padding: 20px; transition-duration: 0.4s; overflow: hidden; box-shadow: 0 3px 9px $color-primary-darkest; border-radius: 4px; - &__icon { + .button__icon { font-size: 2em; } diff --git a/src/presentation/components/Code/CodeButtons/Save/Instructions/CodeInstruction.vue b/src/presentation/components/Code/CodeButtons/Save/Instructions/CodeInstruction.vue index 54313fb1..cb505a6c 100644 --- a/src/presentation/components/Code/CodeButtons/Save/Instructions/CodeInstruction.vue +++ b/src/presentation/components/Code/CodeButtons/Save/Instructions/CodeInstruction.vue @@ -4,11 +4,7 @@
- + @@ -20,13 +16,13 @@ - - diff --git a/src/presentation/components/Scripts/View/Cards/CardListItem.vue b/src/presentation/components/Scripts/View/Cards/CardListItem.vue index 906fc8b1..a38372b3 100644 --- a/src/presentation/components/Scripts/View/Cards/CardListItem.vue +++ b/src/presentation/components/Scripts/View/Cards/CardListItem.vue @@ -31,7 +31,7 @@
- @@ -51,6 +51,7 @@ import { defineComponent, computed, shallowRef, } from 'vue'; import AppIcon from '@/presentation/components/Shared/Icon/AppIcon.vue'; +import FlatButton from '@/presentation/components/Shared/FlatButton.vue'; import { injectKey } from '@/presentation/injectionSymbols'; import ScriptsTree from '@/presentation/components/Scripts/View/Tree/ScriptsTree.vue'; import { sleep } from '@/infrastructure/Threading/AsyncSleep'; @@ -61,6 +62,7 @@ export default defineComponent({ ScriptsTree, AppIcon, CardSelectionIndicator, + FlatButton, }, props: { categoryId: { diff --git a/src/presentation/components/Scripts/View/TheScriptsView.vue b/src/presentation/components/Scripts/View/TheScriptsView.vue index 4a24ef1f..10d303da 100644 --- a/src/presentation/components/Scripts/View/TheScriptsView.vue +++ b/src/presentation/components/Scripts/View/TheScriptsView.vue @@ -17,7 +17,7 @@ class="search__query__close-button" @click="clearSearchQuery()" > - +
@@ -39,19 +39,19 @@ import { defineComponent, PropType, ref, computed, } from 'vue'; -import AppIcon from '@/presentation/components/Shared/Icon/AppIcon.vue'; import { injectKey } from '@/presentation/injectionSymbols'; import ScriptsTree from '@/presentation/components/Scripts/View/Tree/ScriptsTree.vue'; import CardList from '@/presentation/components/Scripts/View/Cards/CardList.vue'; import { ViewType } from '@/presentation/components/Scripts/Menu/View/ViewType'; import { IReadOnlyUserFilter } from '@/application/Context/State/Filter/IUserFilter'; import { IFilterResult } from '@/application/Context/State/Filter/IFilterResult'; +import FlatButton from '@/presentation/components/Shared/FlatButton.vue'; export default defineComponent({ components: { ScriptsTree, CardList, - AppIcon, + FlatButton, }, props: { currentView: { @@ -149,14 +149,10 @@ $margin-inner: 4px; flex-direction: row; align-items: center; margin-top: 1em; - color: $color-primary; + color: $color-primary-light; .search__query__close-button { - @include clickable; font-size: 1.25em; margin-left: 0.25rem; - @include hover-or-touch { - color: $color-primary-dark; - } } } .search-no-matches { diff --git a/src/presentation/components/Scripts/View/Tree/NodeContent/Documentation/DocumentationText.vue b/src/presentation/components/Scripts/View/Tree/NodeContent/Documentation/DocumentationText.vue index 2cc2e942..3a293a73 100644 --- a/src/presentation/components/Scripts/View/Tree/NodeContent/Documentation/DocumentationText.vue +++ b/src/presentation/components/Scripts/View/Tree/NodeContent/Documentation/DocumentationText.vue @@ -128,7 +128,7 @@ $base-spacing: $text-size; */ @include hover-or-touch { &::after{ - background-color: $globals-color-hover; + background-color: $color-highlight; } } } diff --git a/src/presentation/components/Scripts/View/Tree/NodeContent/Documentation/ToggleDocumentationButton.vue b/src/presentation/components/Scripts/View/Tree/NodeContent/Documentation/ToggleDocumentationButton.vue index 8fa0b0b9..7ca89cf0 100644 --- a/src/presentation/components/Scripts/View/Tree/NodeContent/Documentation/ToggleDocumentationButton.vue +++ b/src/presentation/components/Scripts/View/Tree/NodeContent/Documentation/ToggleDocumentationButton.vue @@ -1,22 +1,23 @@ + + diff --git a/src/presentation/components/Shared/Modal/ModalDialog.vue b/src/presentation/components/Shared/Modal/ModalDialog.vue index 0d363eed..c3b33e1d 100644 --- a/src/presentation/components/Shared/Modal/ModalDialog.vue +++ b/src/presentation/components/Shared/Modal/ModalDialog.vue @@ -6,25 +6,24 @@
-
- -
+ />