From 0587a7791e2afd7f6c9a0640a89bd96c3d1301ef Mon Sep 17 00:00:00 2001 From: Lucas Colombo Date: Thu, 23 Jan 2025 11:04:27 -0300 Subject: [PATCH] =?UTF-8?q?feat:=20=E2=9C=A8=20refactor=20form=20component?= =?UTF-8?q?s=20and=20improve=20styling=20consistency?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/themes/scss/theme/components/_avatar.scss | 6 ++- src/themes/scss/theme/components/_forms.scss | 1 + src/themes/scss/theme/components/_labels.scss | 3 -- .../scss/theme/components/button/index.scss | 3 ++ .../scss/theme/components/forms/_input.scss | 16 +++++++- .../forms/{_dropdown-menu.scss => _menu.scss} | 37 ++++++++++++++++--- .../scss/theme/components/forms/index.scss | 2 +- .../scss/theme/modules/repo/_file-list.scss | 4 ++ 8 files changed, 58 insertions(+), 14 deletions(-) rename src/themes/scss/theme/components/forms/{_dropdown-menu.scss => _menu.scss} (88%) diff --git a/src/themes/scss/theme/components/_avatar.scss b/src/themes/scss/theme/components/_avatar.scss index 08b241c..f8a53a3 100644 --- a/src/themes/scss/theme/components/_avatar.scss +++ b/src/themes/scss/theme/components/_avatar.scss @@ -1,6 +1,8 @@ @mixin avatar { img.ui.avatar, .ui.avatar img, .ui.avatar svg { - border-radius: 50% !important; - object-fit: fill; + &:not(.org-avatar) { + border-radius: 50% !important; + object-fit: fill; + } } } \ No newline at end of file diff --git a/src/themes/scss/theme/components/_forms.scss b/src/themes/scss/theme/components/_forms.scss index 99d3d71..c27a506 100644 --- a/src/themes/scss/theme/components/_forms.scss +++ b/src/themes/scss/theme/components/_forms.scss @@ -4,6 +4,7 @@ @mixin forms { @include forms.dropdown-menu; + @include forms.menu; @include forms.input; } diff --git a/src/themes/scss/theme/components/_labels.scss b/src/themes/scss/theme/components/_labels.scss index 4746cb2..42e5cef 100644 --- a/src/themes/scss/theme/components/_labels.scss +++ b/src/themes/scss/theme/components/_labels.scss @@ -41,7 +41,6 @@ @mixin label-default { .ui.label { - // height: var.get('measure/1.25x'); border-radius: var.get('measure/1.25x'); &.scope-left { @@ -57,7 +56,5 @@ &.green, &.red { color: var(--color-green-contrast) !important; } - } - } \ No newline at end of file diff --git a/src/themes/scss/theme/components/button/index.scss b/src/themes/scss/theme/components/button/index.scss index b60afe1..5037447 100644 --- a/src/themes/scss/theme/components/button/index.scss +++ b/src/themes/scss/theme/components/button/index.scss @@ -53,6 +53,9 @@ .ui.button { border-radius: var(--border-radius); transition: color .1s ease, background-color .1s ease, border-color .1s ease; + padding: calc(#{var.get('measure/.375x')} - 1px) var.get('measure/1x'); + font-size: var.get('font-size/md') !important; + line-height: 20px; &.basic { border-radius: var(--border-radius); diff --git a/src/themes/scss/theme/components/forms/_input.scss b/src/themes/scss/theme/components/forms/_input.scss index c0bfb09..d5c93d8 100644 --- a/src/themes/scss/theme/components/forms/_input.scss +++ b/src/themes/scss/theme/components/forms/_input.scss @@ -29,13 +29,18 @@ border-color: var(--color-input-border); color: var(--color-input-text); border-radius: var(--border-radius); - line-height: normal; + line-height: 20px; min-height: auto; padding: calc(#{var.get('measure/.375x')} - 1px) var.get('measure/.75x'); + + +.ui.button:last-child { + border-top-right-radius: var(--border-radius); + border-bottom-right-radius: var(--border-radius); + } } @include -all-inputs(':hover') { - border-radius: var(--border-radius); + // border-radius: var(--border-radius); border-color: var(--color-input-border); color: var(--color-input-text) } @@ -58,6 +63,12 @@ z-index: 1; } + .ui.action.input>.dropdown:not(:first-child):not(:last-child), + .ui.action.input>.button:not(:first-child):not(:last-child), + .ui.action.input>.buttons:not(:first-child):not(:last-child)>.button { + border-radius: 0 !important; + } + .ui.action.input:not([class*="left action"])>input:focus+.ui.dropdown.selection, .ui.action.input:not([class*="left action"])>input:focus+.ui.dropdown.selection:hover, .ui.action.input:not([class*="left action"])>input:focus+.button, @@ -66,6 +77,7 @@ .ui.action.input:not([class*="left action"])>input:focus+i.icon+.button:hover { border-left-color: var(--color-input-border); } + .ui.form .field>label { margin: 0 0 var.get('measure/.375x'); font-size: var.get('font-size/md'); diff --git a/src/themes/scss/theme/components/forms/_dropdown-menu.scss b/src/themes/scss/theme/components/forms/_menu.scss similarity index 88% rename from src/themes/scss/theme/components/forms/_dropdown-menu.scss rename to src/themes/scss/theme/components/forms/_menu.scss index de1c88a..37ef84c 100644 --- a/src/themes/scss/theme/components/forms/_dropdown-menu.scss +++ b/src/themes/scss/theme/components/forms/_menu.scss @@ -90,12 +90,6 @@ visibility: hidden; } } - - //
- //
- // Breaking change that won't be backward compatible - //
- //
.item-secondary-info { flex-basis: 100%; @@ -177,4 +171,35 @@ } } } +} + +@mixin menu { + .ui.menu { + border-radius: var(--border-radius); + + >.item:first-child { + border-radius: var(--border-radius) 0 0 var(--border-radius); + } + + &.compact:not(.secondary) .item:last-child { + border-radius: 0 var(--border-radius) var(--border-radius) 0; + } + } + + .ui.secondary.menu { + gap: var.get('measure/.25x'); + + &.vertical { + >.item { + border: none; + margin: 0 0 var.get('measure/.25x') 0; + border-radius: var(--border-radius) !important; + } + } + + .dropdown.item.active:hover, a.item.active:hover { + color: var(--color-text); + background: var(--color-hover); + } + } } \ No newline at end of file diff --git a/src/themes/scss/theme/components/forms/index.scss b/src/themes/scss/theme/components/forms/index.scss index 2a3a3ae..9ff06ec 100644 --- a/src/themes/scss/theme/components/forms/index.scss +++ b/src/themes/scss/theme/components/forms/index.scss @@ -1,2 +1,2 @@ -@forward './dropdown-menu'; +@forward './menu'; @forward './input'; \ No newline at end of file diff --git a/src/themes/scss/theme/modules/repo/_file-list.scss b/src/themes/scss/theme/modules/repo/_file-list.scss index 4bfb8ee..6e07737 100644 --- a/src/themes/scss/theme/modules/repo/_file-list.scss +++ b/src/themes/scss/theme/modules/repo/_file-list.scss @@ -96,5 +96,9 @@ #readme { } + + .repository-summary .sub-menu .item { + height: 30px; + } } }