From 4da306b9f79b0bb7a64bb197fb246258cf435b8d Mon Sep 17 00:00:00 2001 From: undergroundwires Date: Wed, 31 Jan 2024 19:54:11 +0100 Subject: [PATCH] Normalize and improve font sizes This commit standardizes font sizes across components for a uniform look. The icon sizes, font weights and line heights are also adjusted accordingly for better standardization and simplicity. - Introduce variables for standard font sizes, enhancing maintainability. - Remove explicit pixel values, replaced with scalable units based on root size. - Remove workaround for line-height adoptation of bigger font-size. - Use consistent small font-size for the code area. - Adjust checkbox tick to scale with font size. --- src/presentation/assets/styles/_fonts.scss | 7 ++++++ src/presentation/assets/styles/_globals.scss | 1 + src/presentation/assets/styles/_mixins.scss | 2 ++ .../Code/CodeButtons/IconButton.vue | 5 ++-- .../RunInstructions/Steps/CopyableCommand.vue | 4 ++-- .../components/Code/TheCodeArea.vue | 1 + .../Selector/SelectionTypeDocumentation.vue | 3 --- .../Scripts/View/Cards/CardList.vue | 2 +- .../Scripts/View/Cards/CardListItem.vue | 5 ++-- .../View/Cards/CardSelectionIndicator.vue | 9 +++++++- .../Scripts/View/TheScriptsView.vue | 4 ++-- .../Documentation/DocumentationText.vue | 8 +++++-- .../ToggleDocumentationButton.vue | 3 +-- .../NodeContent/Markdown/MarkdownText.vue | 1 - .../View/Tree/NodeContent/NodeTitle.vue | 13 +---------- .../View/Tree/NodeContent/ToggleSwitch.vue | 7 +++--- .../View/Tree/TreeView/Node/NodeCheckbox.vue | 23 +++++++++++-------- .../components/Shared/Modal/ModalDialog.vue | 2 +- .../components/Shared/TooltipWrapper.vue | 1 + .../components/TheFooter/DownloadUrlList.vue | 13 ++++------- .../TheFooter/DownloadUrlListItem.vue | 11 ++++----- .../components/TheFooter/TheFooter.vue | 1 - src/presentation/components/TheHeader.vue | 6 ++--- src/presentation/components/TheSearchBar.vue | 4 ++-- src/presentation/index.html | 4 +--- 25 files changed, 70 insertions(+), 70 deletions(-) diff --git a/src/presentation/assets/styles/_fonts.scss b/src/presentation/assets/styles/_fonts.scss index 671b8aa8..27a4f2bf 100644 --- a/src/presentation/assets/styles/_fonts.scss +++ b/src/presentation/assets/styles/_fonts.scss @@ -33,3 +33,10 @@ $font-normal : 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace; $font-artistic : 'Yesteryear', cursive; $font-main : 'Slabo 27px'; + +$font-size-smaller : 14px; +$font-size-small : 16px; +$font-size-normal : 18px; +$font-size-large : 22px; +$font-size-larger : 26px; +$font-size-largest : 40px; diff --git a/src/presentation/assets/styles/_globals.scss b/src/presentation/assets/styles/_globals.scss index f88ea946..fdc10d52 100644 --- a/src/presentation/assets/styles/_globals.scss +++ b/src/presentation/assets/styles/_globals.scss @@ -20,4 +20,5 @@ a { body { background: $color-background; font-family: $font-main; + font-size: $font-size-normal; } diff --git a/src/presentation/assets/styles/_mixins.scss b/src/presentation/assets/styles/_mixins.scss index 135e6768..eb201285 100644 --- a/src/presentation/assets/styles/_mixins.scss +++ b/src/presentation/assets/styles/_mixins.scss @@ -1,4 +1,5 @@ @use "@/presentation/assets/styles/colors" as *; +@use "@/presentation/assets/styles/fonts" as *; @mixin hover-or-touch($selector-suffix: '', $selector-prefix: '&') { @media (hover: hover) { @@ -92,6 +93,7 @@ @mixin flat-button($disabled: false) { @include reset-button; + $font-size: $font-size-normal; @if $disabled { color: $color-primary-light; diff --git a/src/presentation/components/Code/CodeButtons/IconButton.vue b/src/presentation/components/Code/CodeButtons/IconButton.vue index d0978312..d1e28b8e 100644 --- a/src/presentation/components/Code/CodeButtons/IconButton.vue +++ b/src/presentation/components/Code/CodeButtons/IconButton.vue @@ -81,7 +81,7 @@ export default defineComponent({ border-radius: 4px; .button__icon { - font-size: 2em; + font-size: $font-size-larger; } @include clickable; @@ -99,10 +99,9 @@ export default defineComponent({ .button__text { display: none; font-family: $font-artistic; - font-size: 1.5em; + font-size: $font-size-large; color: $color-primary; font-weight: 500; - line-height: 1.1; @include hover-or-touch { display: block; } diff --git a/src/presentation/components/Code/CodeButtons/Save/RunInstructions/Steps/CopyableCommand.vue b/src/presentation/components/Code/CodeButtons/Save/RunInstructions/Steps/CopyableCommand.vue index 9377b35b..03ff0fad 100644 --- a/src/presentation/components/Code/CodeButtons/Save/RunInstructions/Steps/CopyableCommand.vue +++ b/src/presentation/components/Code/CodeButtons/Save/RunInstructions/Steps/CopyableCommand.vue @@ -63,14 +63,14 @@ export default defineComponent({ padding: 0.2rem; .dollar { margin-right: 0.5rem; - font-size: 0.8rem; + font-size: $font-size-smaller; user-select: none; } .copy-action-container { margin-left: 1rem; } code { - font-size: 1rem; + font-size: $font-size-small; } } diff --git a/src/presentation/components/Code/TheCodeArea.vue b/src/presentation/components/Code/TheCodeArea.vue index c7949c8e..5968231f 100644 --- a/src/presentation/components/Code/TheCodeArea.vue +++ b/src/presentation/components/Code/TheCodeArea.vue @@ -203,6 +203,7 @@ function getDefaultCode(language: ScriptingLanguage): string { width: 100%; height: 100%; overflow: auto; + font-size: $font-size-small; &__highlight { background-color: $color-secondary-light; position: absolute; diff --git a/src/presentation/components/Scripts/Menu/Selector/SelectionTypeDocumentation.vue b/src/presentation/components/Scripts/Menu/Selector/SelectionTypeDocumentation.vue index 02fa22a1..04a69d17 100644 --- a/src/presentation/components/Scripts/Menu/Selector/SelectionTypeDocumentation.vue +++ b/src/presentation/components/Scripts/Menu/Selector/SelectionTypeDocumentation.vue @@ -101,9 +101,6 @@ ul { padding-left: 0em; margin-top: 0.25em; list-style: disc; - li { - line-height: 1.2em; - } } .sections { display: flex; diff --git a/src/presentation/components/Scripts/View/Cards/CardList.vue b/src/presentation/components/Scripts/View/Cards/CardList.vue index 2400bcf4..e112ba56 100644 --- a/src/presentation/components/Scripts/View/Cards/CardList.vue +++ b/src/presentation/components/Scripts/View/Cards/CardList.vue @@ -142,7 +142,7 @@ function isClickable(element: Element) { .error { width: 100%; text-align: center; - font-size: 3.5em; + font-size: $font-size-largest; font-family: $font-normal; } diff --git a/src/presentation/components/Scripts/View/Cards/CardListItem.vue b/src/presentation/components/Scripts/View/Cards/CardListItem.vue index b74984aa..616c7d6e 100644 --- a/src/presentation/components/Scripts/View/Cards/CardListItem.vue +++ b/src/presentation/components/Scripts/View/Cards/CardListItem.vue @@ -145,7 +145,6 @@ $card-horizontal-gap : $card-gap; @include clickable; background-color: $color-primary; color: $color-on-primary; - font-size: 1.5em; height: 100%; width: 100%; text-transform: uppercase; @@ -169,6 +168,7 @@ $card-horizontal-gap : $card-gap; flex-direction: column; flex: 1; justify-content: center; + font-size: $font-size-large; } .card__inner__selection_indicator { height: $card-inner-padding; @@ -181,6 +181,7 @@ $card-horizontal-gap : $card-gap; width: 100%; margin-top: .25em; vertical-align: middle; + font-size: $font-size-normal; } } .card__expander { @@ -202,7 +203,7 @@ $card-horizontal-gap : $card-gap; } .card__expander__close-button { - font-size: 1.5em; + font-size: $font-size-large; align-self: flex-end; margin-right: 0.25em; @include clickable; diff --git a/src/presentation/components/Scripts/View/Cards/CardSelectionIndicator.vue b/src/presentation/components/Scripts/View/Cards/CardSelectionIndicator.vue index 42b1493e..80837b88 100644 --- a/src/presentation/components/Scripts/View/Cards/CardSelectionIndicator.vue +++ b/src/presentation/components/Scripts/View/Cards/CardSelectionIndicator.vue @@ -1,5 +1,5 @@