diff --git a/components/common/label/label.css b/components/common/label/label.css new file mode 100644 index 0000000..8054b58 --- /dev/null +++ b/components/common/label/label.css @@ -0,0 +1,38 @@ +/* + * Label: GitHub's pill-shaped outline label. Add theme-label to a Forgejo ".ui label". + * + * By default the outline takes the label's own text colour, so Forgejo's coloured labels (green, + * orange) keep their meaning. Modifiers: + * theme-label-muted grey text and border, for neutral facts such as visibility + * theme-label-solid filled grey with white text, for a draft + * theme-label-large 24px tall, for use beside a large title + * + * The declarations are !important because the theme's general label rules are loaded later and + * are more specific. + */ +.ui.ui.ui.label.theme-label { + display: inline-block !important; + padding: 0 7px !important; + border: 1px solid currentcolor !important; + border-radius: 2em !important; + background: transparent !important; + font-size: 12px !important; + font-weight: 500 !important; + line-height: 18px !important; + vertical-align: middle !important; +} + +.ui.ui.ui.label.theme-label-muted { + border-color: var(--color-secondary) !important; + color: var(--color-text-light-1) !important; +} + +.ui.ui.ui.label.theme-label-solid { + border-color: var(--github-bgColor-neutral-emphasis) !important; + background: var(--github-bgColor-neutral-emphasis) !important; + color: var(--github-fgColor-onEmphasis) !important; +} + +.ui.ui.ui.label.theme-label-large { + padding: 2px 8px !important; +} diff --git a/styles/pages/organization.css b/styles/pages/organization.css index fcad19d..22b28ae 100644 --- a/styles/pages/organization.css +++ b/styles/pages/organization.css @@ -72,17 +72,9 @@ body:has(.organization-global-header) .page-content:is(.organization, .packages) line-height: 21px; } -/* The visibility badge is GitHub's outlined label, not a filled pill. */ +/* The visibility badge is the shared outlined label; it only loses Forgejo's margin here. */ .page-content.organization .org-title .org-visibility .ui.label { margin: 0; - padding: 0 7px; - border: 1px solid var(--color-secondary); - border-radius: 2em; - background: transparent; - color: var(--color-text-light-1); - font-size: 12px; - font-weight: 500; - line-height: 18px; } .org-overview-grid { diff --git a/styles/pages/releases.css b/styles/pages/releases.css index c2badd4..11b4079 100644 --- a/styles/pages/releases.css +++ b/styles/pages/releases.css @@ -343,17 +343,6 @@ body:has(.page-content.repository.github-releases) .repository-content-header { .release-title-wrap h4 a[data-tippy="commit-statuses"] { margin-left: 0; } - .release-title-wrap h4 .ui.label { - display: inline-block; - vertical-align: middle; - background: transparent; - border: 1px solid currentColor; - border-radius: 24px; - font-size: 12px; - font-weight: 500; - line-height: 18px; - padding: 2px 8px; - } .github-release-latest { display: inline; margin-left: 8px; @@ -605,12 +594,6 @@ body:has(.page-content.repository.github-releases) .repository-content-header { .github-release-list .markup ul ul ul { list-style-type: square; } - /* Draft is a solid grey label, like a draft pull request's. */ - .release-title-wrap .github-release-draft.ui.ui.label { - border-color: var(--github-bgColor-neutral-emphasis) !important; - background: var(--github-bgColor-neutral-emphasis) !important; - color: var(--github-fgColor-onEmphasis) !important; - } /* Asset rows */ .detail .download .list > li { min-height: 45px; diff --git a/templates/base/component_assets.tmpl b/templates/base/component_assets.tmpl index 0dc5201..8083c3a 100644 --- a/templates/base/component_assets.tmpl +++ b/templates/base/component_assets.tmpl @@ -2,6 +2,7 @@ + diff --git a/templates/org/header.tmpl b/templates/org/header.tmpl index a3cc6b7..1e35c9b 100644 --- a/templates/org/header.tmpl +++ b/templates/org/header.tmpl @@ -6,8 +6,8 @@

{{.Org.DisplayName}}

- {{if .Org.Visibility.IsLimited}}{{ctx.Locale.Tr "org.settings.visibility.limited_shortname"}}{{end}} - {{if .Org.Visibility.IsPrivate}}{{ctx.Locale.Tr "org.settings.visibility.private_shortname"}}{{end}} + {{if .Org.Visibility.IsLimited}}{{ctx.Locale.Tr "org.settings.visibility.limited_shortname"}}{{end}} + {{if .Org.Visibility.IsPrivate}}{{ctx.Locale.Tr "org.settings.visibility.private_shortname"}}{{end}}
diff --git a/templates/repo/release/list.tmpl b/templates/repo/release/list.tmpl index f86e6cc..981f929 100644 --- a/templates/repo/release/list.tmpl +++ b/templates/repo/release/list.tmpl @@ -48,11 +48,11 @@ {{$release.Title}} {{if $release.IsDraft}} - {{ctx.Locale.Tr "repo.release.draft"}} + {{ctx.Locale.Tr "repo.release.draft"}} {{else if $release.IsPrerelease}} - {{ctx.Locale.Tr "repo.release.prerelease"}} + {{ctx.Locale.Tr "repo.release.prerelease"}} {{else if not $release.IsTag}} - + {{end}} {{template "repo/commit_statuses" dict "Status" $info.CommitStatus "Statuses" $info.CommitStatuses "AdditionalClasses" "tw-flex"}}