From ad8ff731ed59f876bf0ebb04ced65457b1ae4fba Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Fri, 9 Jun 2023 10:35:53 +0800 Subject: [PATCH 1/7] fix alignment --- templates/devtest/gitea-ui.tmpl | 74 ++++++++++++++++++++++++++++ web_src/css/base.css | 87 ++++++++++++++++++++------------- 2 files changed, 128 insertions(+), 33 deletions(-) diff --git a/templates/devtest/gitea-ui.tmpl b/templates/devtest/gitea-ui.tmpl index 824b7d0db6952..8589f6c7cefa4 100644 --- a/templates/devtest/gitea-ui.tmpl +++ b/templates/devtest/gitea-ui.tmpl @@ -117,6 +117,80 @@
1y future: {{TimeSince .TimeFuture1y $.locale}}
+
+

SVG alignment

+
{{svg "octicon-alert"}} {{svg "octicon-x"}} text (block)
+
{{svg "octicon-alert"}} {{svg "octicon-x"}} text
(inline)
+
+
+ + + + + +
+ + +
+
+
+
+ + +

ComboMarkdownEditor

ps: no JS code attached, so just a layout
diff --git a/web_src/css/base.css b/web_src/css/base.css index 38faf2287cc6c..2d7e07134f051 100644 --- a/web_src/css/base.css +++ b/web_src/css/base.css @@ -1042,10 +1042,6 @@ img.ui.avatar, background: var(--color-active); } -.ui.form .field > .selection.dropdown > .dropdown.icon { - height: auto; -} - .ui.loading.segment::before, .ui.loading.form::before { background: none; @@ -2135,35 +2131,6 @@ table th[data-sortt-desc] .svg { margin-left: 0.25rem; } -.ui.dropdown .svg.dropdown.icon, -.ui.dropdown .svg.remove.icon, -.svg.dropdown.icon { - margin-top: 0 !important; /* reset the "ui.selection.dropdown > .dropdown.icon {margin-top}", for the Issue Dependencies dropdown */ - margin-right: -0.5rem !important; /* fix up SVG dropdown triangles because Fomantic thinks they are icon fonts */ - height: auto; /* reset the ".ui.dropdown > .dropdown.icon {height}", otherwise the icon would be too small */ -} - -.ui.selection.dropdown > .svg.search.icon, -.ui.selection.dropdown > .svg.delete.icon, -.ui.selection.dropdown > .svg.dropdown.icon { - top: 0 !important; /* reset the ".ui.selection.dropdown > .xxx.icon {top}" if the icon is svg instead of the fomantic icon */ -} - -.ui.selection.dropdown > .svg.remove.icon { - top: .5px; - right: 32px; - width: auto; -} - -.ui.selection.dropdown > .svg.remove.icon:hover { - opacity: 1; -} - -.ui.dropdown.no-text > .dropdown.icon { - margin-left: 0 !important; - margin-right: 0 !important; -} - .ui.dropdown .menu .item { border-radius: 0; } @@ -2315,3 +2282,57 @@ table th[data-sortt-desc] .svg { width: 15px; height: 15px; } + +.ui.dropdown { + /* the dropdown doesn't have default line-height, use this to make the dropdown icon align with plain dropdown */ + line-height: 1em; +} + +.ui.ui.dropdown > .icon.icon { + /* plain dropdown and button dropdown use flex layout for icons */ + position: initial; + padding: 0; + margin: 0; + height: auto; +} + +.ui.ui.dropdown > .icon.icon:hover { + opacity: 1; +} + +.ui.ui.button.dropdown > .icon.icon, +.ui.ui.selection.dropdown > .icon.icon { + /* selection dropdown uses absolute layout for icons */ + position: absolute; + top: 50%; + transform: translateY(-50%); +} + +.ui.ui.dropdown > .dropdown.icon { + right: 0.5em; +} + +.ui.ui.dropdown > .remove.icon { + right: 2em; /* clear the dropdown, only used in selection dropdown, it's beside the "dropdown icon arrow" */ +} + +.ui.ui.buttons .floating.dropdown.icon.button { + padding-right: 1em; +} + +.ui.ui.button, +.ui.ui.dropdown, +.flex-text-inline { + display: inline-flex; + align-items: center; + flex-wrap: wrap; + gap: .25rem; + vertical-align: middle; +} + +.flex-text-block { + display: flex; + align-items: center; + flex-wrap: wrap; + gap: .25rem; +} From 8c2685cc4d8f000bdc647cb38c30f30741f332ef Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Tue, 13 Jun 2023 20:42:04 +0800 Subject: [PATCH 2/7] improve --- templates/devtest/gitea-ui.tmpl | 8 +- templates/repo/commits_list_small.tmpl | 4 +- templates/repo/issue/view_content/pull.tmpl | 98 +++++++++---------- .../view_content/update_branch_by_merge.tmpl | 9 +- web_src/css/base.css | 24 ++--- web_src/css/modules/button.css | 4 - web_src/css/repo.css | 5 + .../js/components/PullRequestMergeForm.vue | 2 +- 8 files changed, 78 insertions(+), 76 deletions(-) diff --git a/templates/devtest/gitea-ui.tmpl b/templates/devtest/gitea-ui.tmpl index 8589f6c7cefa4..f8fe6f97b81c4 100644 --- a/templates/devtest/gitea-ui.tmpl +++ b/templates/devtest/gitea-ui.tmpl @@ -121,6 +121,10 @@

SVG alignment

{{svg "octicon-alert"}} {{svg "octicon-x"}} text (block)
{{svg "octicon-alert"}} {{svg "octicon-x"}} text
(inline)
+
+
{{svg "octicon-alert"}} flex every line
+
{{svg "octicon-alert"}} flex every item
+
-