Skip to content

Labels: Add an outlined label component and use it for visibility and release labels - #91

Merged
whereareiam merged 1 commit into
devfrom
refactor/label-component
Oct 4, 2026
Merged

whereareiam merged 1 commit into
devfrom
refactor/label-component

Conversation

@whereareiam

Copy link
Copy Markdown
Owner

Stacked on #90 (base is its branch).

What

GitHub's pill-shaped outline label was styled in two places with separate selectors:

  • styles/pages/organization.css: the organization's Private / Limited badge.
  • styles/pages/releases.css: the Draft, Pre-release and Latest labels beside a release title, plus a separate rule making Draft solid.

components/common/label/label.css (new, linked from component_assets.tmpl) provides one class for a Forgejo .ui label:

Class Effect
theme-label 12px / 500, 18px line, 0 7px, 1px outline in the label's own text colour, pill radius, transparent
theme-label-muted grey text and border (visibility)
theme-label-solid filled grey, white text (draft)
theme-label-large 2px 8px, 24px tall (beside a large title)

templates/org/header.tmpl and templates/repo/release/list.tmpl add the classes; the bespoke rules are removed. The organization page keeps one line removing Forgejo's label margin.

The declarations are !important because the theme's general label rules load later and are more specific; without that the labels changed by a pixel or two.

Not converted: labels Forgejo renders itself (pull request and issue state labels, the repository visibility label in the header), which cannot take a class.

Verification

Measured on the previous branch and on this one. All four labels are identical: Draft 47×24px solid grey with its 8px left margin, Pre-release 85×24px orange outline, Latest 54×24px green outline, organization badge 56×20px muted with 0 7px padding. bun vitest (403 passed), bun check and Prettier pass.

🤖 Generated with Claude Code

… release labels

The pill-shaped outline label was written twice: for the organization's
visibility badge and for the Draft, Pre-release and Latest labels beside
a release title, each with its own selector.

components/common/label/label.css now provides theme-label with three
modifiers (muted, solid, large). The org header and the release list add
the classes and the two bespoke rules are removed.

No visual change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@whereareiam whereareiam added the skip-changelog Internal change excluded from release notes label Oct 4, 2026
Base automatically changed from refactor/control-sizing to dev October 4, 2026 15:43
@whereareiam
whereareiam merged commit 80d950f into dev Oct 4, 2026
7 checks passed
@whereareiam
whereareiam deleted the refactor/label-component branch October 4, 2026 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-changelog Internal change excluded from release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant