Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove fomantic header module #30033

Merged
merged 10 commits into from
Mar 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions templates/repo/diff/box.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
{{$isExpandable := or (gt $file.Addition 0) (gt $file.Deletion 0) $file.IsBin}}
{{$isReviewFile := and $.IsSigned $.PageIsPullFiles (not $.IsArchived) $.IsShowingAllCommits}}
<div class="diff-file-box diff-box file-content {{TabSizeClass $.Editorconfig $file.Name}} gt-mt-0" id="diff-{{$file.NameHash}}" data-old-filename="{{$file.OldName}}" data-new-filename="{{$file.Name}}" {{if or ($file.ShouldBeHidden) (not $isExpandable)}}data-folded="true"{{end}}>
<h4 class="diff-file-header sticky-2nd-row ui top attached normal header tw-flex tw-items-center tw-justify-between tw-flex-wrap">
<h4 class="diff-file-header sticky-2nd-row ui top attached header tw-font-normal tw-flex tw-items-center tw-justify-between tw-flex-wrap">
<div class="diff-file-name tw-flex tw-items-center gt-gap-2 tw-flex-wrap">
<button class="fold-file btn interact-bg gt-p-2{{if not $isExpandable}} tw-invisible{{end}}">
{{if $file.ShouldBeHidden}}
Expand Down Expand Up @@ -218,7 +218,7 @@

{{if .Diff.IsIncomplete}}
<div class="diff-file-box diff-box file-content gt-mt-3" id="diff-incomplete">
<h4 class="ui top attached normal header tw-flex tw-items-center tw-justify-between">
<h4 class="ui top attached header tw-font-normal tw-flex tw-items-center tw-justify-between">
{{ctx.Locale.Tr "repo.diff.too_many_files"}}
<a class="ui basic tiny button" id="diff-show-more-files" data-href="?skip-to={{.Diff.End}}&file-only=true">{{ctx.Locale.Tr "repo.diff.show_more"}}</a>
</h4>
Expand Down
2 changes: 1 addition & 1 deletion templates/shared/search/code/results.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
{{range $result := .SearchResults}}
{{$repo := or $.Repo (index $.RepoMaps .RepoID)}}
<div class="diff-file-box diff-box file-content non-diff-file-content repo-search-result">
<h4 class="ui top attached normal header tw-flex tw-flex-wrap">
<h4 class="ui top attached header tw-font-normal tw-flex tw-flex-wrap">
{{if not $.Repo}}
<span class="file tw-flex-1">
<a rel="nofollow" href="{{$repo.Link}}">{{$repo.FullName}}</a>
Expand Down
86 changes: 0 additions & 86 deletions web_src/css/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -297,10 +297,6 @@ a.label,
background-color: var(--color-markup-code-block);
}

.ui.dividing.header {
border-bottom-color: var(--color-secondary);
}

/* fix Fomantic's line-height cutting off "g" on Windows Chrome with Segoe UI */
.ui.input > input {
line-height: var(--line-height-default);
Expand Down Expand Up @@ -576,22 +572,10 @@ ol.ui.list li,
visibility: visible !important;
}

.ui.error.header {
background: var(--color-error-bg) !important;
color: var(--color-error-text) !important;
border-color: var(--color-error-border) !important;
}

.ui.error.segment {
border-color: var(--color-error-border) !important;
}

.ui.warning.header {
background: var(--color-warning-bg) !important;
color: var(--color-warning-text) !important;
border-color: var(--color-warning-border) !important;
}

.ui.warning.segment {
border-color: var(--color-warning-border) !important;
}
Expand Down Expand Up @@ -1085,10 +1069,6 @@ input:-webkit-autofill:active,
margin-bottom: 0;
}

.ui .normal.header {
font-weight: var(--font-weight-normal);
}

.ui .form .autofill-dummy {
position: absolute;
width: 1px;
Expand Down Expand Up @@ -1246,17 +1226,6 @@ input:-webkit-autofill:active,
margin-right: 0;
}

.ui.icon.header svg {
width: 3em;
height: 3em;
float: none;
display: block;
line-height: var(--line-height-default);
padding: 0;
margin: 0 auto 0.5rem;
opacity: 1;
}

.ui.floating.dropdown .overflow.menu .scrolling.menu.items {
border-radius: 0 !important;
box-shadow: none !important;
Expand Down Expand Up @@ -1284,11 +1253,6 @@ input:-webkit-autofill:active,
border-radius: var(--border-radius);
}

.attention-header {
padding: 0.5em 0.75em !important;
color: var(--color-text) !important;
}

.attention-icon {
margin: 2px 6px 0 0;
}
Expand Down Expand Up @@ -1758,35 +1722,6 @@ a.ui.basic.label:hover {
color: var(--color-text-light);
}

.ui.attached.header {
position: relative;
background: var(--color-box-header);
border-color: var(--color-secondary);
}

/* fix misaligned right buttons on box headers */
.ui.attached.header > .ui.right {
position: absolute;
right: 0.78571429rem;
top: 0;
bottom: 0;
display: flex;
align-items: center;
gap: 0.25em;
}

/* the default ".ui.attached.header > .ui.right" is only able to contain "tiny" buttons, other buttons are too large */
.ui.attached.header > .ui.right .ui.tiny.button {
padding: 6px 10px;
font-weight: var(--font-weight-normal);
}

/* if a .top.attached.header is followed by a .segment, add some margin */
.ui.segments + .ui.top.attached.header,
.ui.attached.segment + .ui.top.attached.header {
margin-top: 1rem;
}

.rss-icon {
display: inline-flex;
color: var(--color-text-light-1);
Expand Down Expand Up @@ -1842,11 +1777,6 @@ table th[data-sortt-desc] .svg {
background: var(--color-secondary-dark-1) !important;
}

/* https://github.com/go-gitea/gitea/pull/11486 */
.ui.sub.header {
text-transform: none;
}

.ui.tabular.menu {
border-color: var(--color-secondary);
}
Expand Down Expand Up @@ -1897,22 +1827,6 @@ table th[data-sortt-desc] .svg {
height: 0;
}

.ui.header {
color: var(--color-text);
}

.ui.header .ui.label {
margin-left: 0.25rem;
}

.ui.header > .ui.label.compact {
margin-top: inherit;
}

.ui.header .sub.header {
color: var(--color-text-light-1);
}

.flash-error details code,
.flash-warning details code {
display: block;
Expand Down
1 change: 1 addition & 0 deletions web_src/css/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
@import "./modules/svg.css";
@import "./modules/flexcontainer.css";
@import "./modules/message.css";
@import "./modules/header.css";

@import "./shared/flex-list.css";
@import "./shared/milestone.css";
Expand Down
171 changes: 171 additions & 0 deletions web_src/css/modules/header.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
/* based on Fomantic UI header module, with just the parts extracted that we use. If you find any
unused rules here after refactoring, please remove them. */

.ui.header {
silverwind marked this conversation as resolved.
Show resolved Hide resolved
color: var(--color-text);
border: none;
margin: calc(2rem - 0.1428571428571429em) 0 1rem;
padding: 0;
font-family: var(--fonts-regular);
font-weight: var(--font-weight-medium);
line-height: 1.28571429;
text-transform: none;
}

.ui.header:first-child {
margin-top: -0.14285714em;
}

.ui.header:last-child {
margin-bottom: 0;
}

.ui.header .ui.label {
margin-left: 0.25rem;
vertical-align: middle;
}

.ui.header > .ui.label.compact {
margin-top: inherit;
}

.ui.header .sub.header {
display: block;
font-weight: var(--font-weight-normal);
padding: 0;
margin: 0;
font-size: 1rem;
line-height: 1.2;
color: var(--color-text-light-1);
}

.ui.header > i.icon {
display: table-cell;
opacity: 1;
font-size: 1.5em;
padding-top: 0;
vertical-align: middle;
}

.ui.header > i.icon:only-child {
display: inline-block;
padding: 0;
margin-right: 0.75rem;
}

.ui.header + p {
margin-top: 0;
}

h2.ui.header {
font-size: 1.71428571rem;
}
h2.ui.header .sub.header {
font-size: 1.14285714rem;
}

h4.ui.header {
font-size: 1.07142857rem;
}
h4.ui.header .sub.header {
font-size: 1rem;
}

.ui.sub.header {
padding: 0;
margin-bottom: 0.14285714rem;
font-weight: var(--font-weight-normal);
font-size: 0.85714286em;
}

.ui.icon.header svg {
width: 3em;
height: 3em;
float: none;
display: block;
line-height: var(--line-height-default);
padding: 0;
margin: 0 auto 0.5rem;
opacity: 1;
}

.ui.header:not(h1,h2,h3,h4,h5,h6) {
font-size: 1.28571429em;
}

.ui.attached.header {
position: relative;
background: var(--color-box-header);
padding: 0.78571429rem 1rem;
margin: 0 -1px;
border-radius: 0;
border: 1px solid var(--color-secondary);
}

.ui.attached:not(.top).header {
border-top: none;
}

.ui.top.attached.header {
border-radius: 0.28571429rem 0.28571429rem 0 0;
}

.ui.bottom.attached.header {
border-radius: 0 0 0.28571429rem 0.28571429rem;
}

.ui.attached.header:not(h1,h2,h3,h4,h5,h6) {
font-size: 1em;
}

/* fix misaligned right buttons on box headers */
.ui.attached.header > .ui.right {
position: absolute;
right: 0.78571429rem;
top: 0;
bottom: 0;
display: flex;
align-items: center;
gap: 0.25em;
}

/* the default ".ui.attached.header > .ui.right" is only able to contain "tiny" buttons, other buttons are too large */
.ui.attached.header > .ui.right .ui.tiny.button {
padding: 6px 10px;
font-weight: var(--font-weight-normal);
}

/* if a .top.attached.header is followed by a .segment, add some margin */
.ui.segments + .ui.top.attached.header,
.ui.attached.segment + .ui.top.attached.header {
margin-top: 1rem;
}

.ui.dividing.header {
border-bottom-color: var(--color-secondary);
}

.ui.dividing.header .sub.header {
padding-bottom: 0.21428571rem;
}

.ui.dividing.header i.icon {
margin-bottom: 0;
}

.ui.error.header {
background: var(--color-error-bg) !important;
color: var(--color-error-text) !important;
border-color: var(--color-error-border) !important;
}

.ui.warning.header {
background: var(--color-warning-bg) !important;
color: var(--color-warning-text) !important;
border-color: var(--color-warning-border) !important;
}

.attention-header {
padding: 0.5em 0.75em !important;
color: var(--color-text) !important;
}
Loading