Use flex to align SVG and text (#25163)

The code can be as simple as:

```html
<div class="flex-text-block">{{svg "octicon-alert"}} {{svg "octicon-x"}} text (block)</div>
<div><div class="flex-text-inline">{{svg "octicon-alert"}} {{svg "octicon-x"}} text</div> (inline)</div>
<div><button class="ui red button">{{svg "octicon-alert" 24}} {{svg "octicon-x" 24}} text</button></div>
```


![image](1d3c10f1-0bc7-4c26-b236-bad537d5c465)

---------

Co-authored-by: Giteabot <teabot@gitea.io>
This commit is contained in:
wxiaoguang 2023-06-15 00:40:15 +08:00 committed by GitHub
parent 4c290e9209
commit 46c17c8029
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 247 additions and 131 deletions

View file

@ -20,15 +20,6 @@
margin-top: 2px;
}
.repository .repo-header .repo-buttons .svg {
margin: 0 0.42857143em 0 -0.21428571em;
}
.repository .repo-header .button {
margin-top: 2px;
margin-bottom: 2px;
}
.repository .tabs .navbar {
justify-content: initial;
}
@ -850,6 +841,11 @@
padding-top: 0;
}
.repository.view.issue .comment-list .timeline-item.commits-list .ui.avatar,
.repository.view.issue .comment-list .timeline-item.event .ui.avatar {
margin-right: 0.25em;
}
.repository.view.issue .comment-list .timeline-item.commits-list .singular-commit {
line-height: 34px; /* this must be same as .badge height, to avoid overflow */
clear: both; /* reset the "float right shabox", in the future, use flexbox instead */
@ -2537,11 +2533,6 @@
margin-left: 0.25rem;
}
.content-history-menu .octicon-triangle-down {
position: relative;
top: 1.5px;
}
.comment-body {
background: var(--color-box-body);
border: none !important;
@ -2874,6 +2865,7 @@ tbody.commit-list {
flex-direction: row;
flex-wrap: wrap;
word-break: keep-all;
gap: 0.25em;
}
@media (max-width: 767.98px) {
@ -2897,15 +2889,6 @@ tbody.commit-list {
color: var(--color-primary-dark-1);
}
.repo-buttons .ui.labeled.button {
cursor: initial;
}
.repo-buttons .ui.labeled.button > .label {
border-left: 0 !important;
margin: 0 !important;
}
.repo-buttons .ui.labeled.button.disabled {
pointer-events: inherit !important;
}