Skip to content

refactor: lint bare fill/stroke colors, add vars for git graph color series#37543

Merged
silverwind merged 9 commits into
go-gitea:mainfrom
silverwind:stylelint-fill-stroke
May 7, 2026
Merged

refactor: lint bare fill/stroke colors, add vars for git graph color series#37543
silverwind merged 9 commits into
go-gitea:mainfrom
silverwind:stylelint-fill-stroke

Conversation

@silverwind
Copy link
Copy Markdown
Member

@silverwind silverwind commented May 4, 2026

  • make scale-unlimited/declaration-strict-value cover fill and stroke
  • add new color vars for color series in gitgraph
  • move most rule disablement to per-line
  • remove dead highlight colors since Fix git graph page #34948
  • move stylelint config to ts now that the linked issue is fixed

This PR was written with the help of Claude Opus 4.7

The `scale-unlimited/declaration-strict-value` rule only checked
properties matching `/color$/` plus `font-weight`, so SVG paint
properties (`fill`, `stroke`) silently allowed literal hex values.

Add `fill`/`stroke` to the rule's property list. Drop both `overrides`
blocks: `**/chroma/*` and `**/codemirror/*` no longer match anything in
the tree, and the live exclusions (`console.css`, `font_i18n.css`,
`gitgraph.css`) move to per-file `stylelint-disable` comments with the
reason inline.

Co-Authored-By: Claude (Opus 4.7) <noreply@anthropic.com>
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label May 4, 2026
silverwind and others added 4 commits May 5, 2026 00:03
- console.css / font_i18n.css: per-line `stylelint-disable-line` on the
  declarations that need them (xterm-256 palette, numeric font-weight).
- gitgraph.css: extract the 16 branch flow colors into
  `--color-series-16-0` … `--color-series-16-15` (defined in both light
  and dark themes), and derive the highlight palette via
  `color-mix(in oklch, var(--color-series-16-N), white 15%)` instead of
  carrying a parallel hardcoded palette.

Co-Authored-By: Claude (Opus 4.7) <noreply@anthropic.com>
Best single-percentage fit to the original highlight colors across all
16 entries (avg ΔE 0.063 in OKLab; the original palette is hand-tuned
per-color so no single recipe matches exactly).

Co-Authored-By: Claude (Opus 4.7) <noreply@anthropic.com>
- Add `--color-series-16-highlight-N` to both theme files, defined as
  `color-mix(in srgb, var(--color-series-16-N), white 13%)`.
- Switch gitgraph.css highlight rules to use the new vars instead of
  inline `color-mix(...)`.
- New `templates/devtest/series-colors.tmpl` showcases all 32 colors
  (auto-listed via `/devtest`).

Co-Authored-By: Claude (Opus 4.7) <noreply@anthropic.com>
Co-Authored-By: Claude (Opus 4.7) <noreply@anthropic.com>
Comment thread web_src/css/features/console.css Outdated
@silverwind
Copy link
Copy Markdown
Member Author

Turns out the highlight colors were dead code since #34948, removing.

…le.css

- Remove `.flow-group.highlight.flow-color-16-N` rules and the matching
  `--color-series-16-highlight-N` vars: dead since PR go-gitea#34948 (commit
  70685a9) removed the JS hover handlers in July 2025.
- Drop the corresponding row from the devtest page.
- Revert console.css to file-level `stylelint-disable` (terminal ANSI
  palette is one block; per-line was noisy across 240 rows).

Co-Authored-By: Claude (Opus 4.7) <noreply@anthropic.com>
@silverwind silverwind changed the title Lint bare fill/stroke colors, clean stylelint overrides Lint bare fill/stroke colors, add vars for git graph color series May 4, 2026
Co-Authored-By: Claude (Opus 4.7) <noreply@anthropic.com>
@silverwind silverwind requested a review from Copilot May 4, 2026 22:45
@silverwind silverwind changed the title Lint bare fill/stroke colors, add vars for git graph color series chore: Lint bare fill/stroke colors, add vars for git graph color series May 4, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR tightens CSS linting around color usage (now including SVG fill/stroke) and refactors the git graph color palette to be theme-driven via new CSS variables, while adjusting stylelint disablements to be more localized.

Changes:

  • Extend scale-unlimited/declaration-strict-value to enforce strict values for fill and stroke (in addition to color props and font-weight).
  • Introduce --color-series-16-* theme variables and switch git graph flow colors from hardcoded hex to these variables.
  • Replace prior stylelint file overrides with in-file/per-line disable comments for console.css and font_i18n.css.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
web_src/css/themes/theme-gitea-light.css Adds --color-series-16-* variables for theme-driven 16-color series usage.
web_src/css/themes/theme-gitea-dark.css Adds matching --color-series-16-* variables for dark theme.
web_src/css/font_i18n.css Adds per-line stylelint disables for numeric font-weight values in @font-face rules.
web_src/css/features/gitgraph.css Replaces hardcoded series colors with --color-series-16-* variables and removes highlight-specific series colors.
web_src/css/features/console.css Adds a scoped file-level stylelint disable for strict-value rule due to literal xterm palette values.
stylelint.config.js Updates strict-value rule to include fill/stroke and removes prior file-based overrides.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread web_src/css/features/gitgraph.css
Issue stylelint/stylelint#8893 (intermittent `ConfigurationError: No
configuration provided`) was fixed in 17.10.0; the workaround note can
go.

Co-Authored-By: Claude (Opus 4.7) <noreply@anthropic.com>
@silverwind silverwind changed the title chore: Lint bare fill/stroke colors, add vars for git graph color series chore: lint bare fill/stroke colors, add vars for git graph color series May 5, 2026
@silverwind silverwind changed the title chore: lint bare fill/stroke colors, add vars for git graph color series refactor: lint bare fill/stroke colors, add vars for git graph color series May 5, 2026
@silverwind silverwind requested a review from Copilot May 6, 2026 02:35
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@silverwind silverwind requested a review from bircni May 7, 2026 01:01
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels May 7, 2026
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels May 7, 2026
@silverwind silverwind enabled auto-merge (squash) May 7, 2026 21:13
@silverwind silverwind added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label May 7, 2026
@silverwind silverwind merged commit 6a509da into go-gitea:main May 7, 2026
23 checks passed
@silverwind silverwind deleted the stylelint-fill-stroke branch May 7, 2026 21:18
@GiteaBot GiteaBot added this to the 1.27.0 milestone May 7, 2026
@GiteaBot GiteaBot removed the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label May 7, 2026
silverwind added a commit to silverwind/gitea that referenced this pull request May 8, 2026
* origin/main: (41 commits)
  refactor: only reset a database table when the table's data was changed (go-gitea#37573)
  refactor: lint bare `fill`/`stroke` colors, add vars for git graph color series (go-gitea#37543)
  fix(actions): report individual step status in workflow job API response (go-gitea#37592)
  ci: allow `chore` type in PR title lint (go-gitea#37575)
  refactor: remove obsolete export (go-gitea#37579)
  fix: Invalid UTF-8 commit messages in JSON API responses (go-gitea#37542)
  fix: use consistent GetUser family functions (go-gitea#37553)
  fix(api): return 409 message instead of empty JSON for wrong commit id (go-gitea#37572)
  fix(actions): prevent panic when workflow contains null jobs (go-gitea#37570)
  [skip ci] Updated translations via Crowdin
  refactor: use modernc sqlite driver as default (go-gitea#37562)
  refactor(templates): remove ctxData from tmpl files, use ctx.RootData instead (go-gitea#37567)
  ci: increase renovate frequency and fix RENOVATE_ALLOWED_POST_UPGRADE_COMMANDS (go-gitea#37565)
  fix(deps): update go dependencies (go-gitea#37541)
  refactor(deps): migrate from `nektos/act` fork to `gitea/runner` (go-gitea#37557)
  ci: lint PR titles with commitlint (go-gitea#37498)
  Make ServeSetHeaders default to download attachment if filename exists (go-gitea#37552)
  fix(actions): validate workflow param to prevent 500 error (go-gitea#37546)
  Fix various problems (go-gitea#37547)
  docs: fix 4 typos in CHANGELOG.md (go-gitea#37549)
  ...

# Conflicts:
#	templates/repo/actions/runs_list.tmpl
#	templates/repo/issue/view_content/pull_merge_box.tmpl
#	templates/repo/pulls/status.tmpl
silverwind added a commit to silverwind/gitea that referenced this pull request May 8, 2026
* origin/main:
  chore(renovate): detect Makefile tools, enable `go` bumps (go-gitea#37595)
  refactor: only reset a database table when the table's data was changed (go-gitea#37573)
  refactor: lint bare `fill`/`stroke` colors, add vars for git graph color series (go-gitea#37543)
  fix(actions): report individual step status in workflow job API response (go-gitea#37592)
  ci: allow `chore` type in PR title lint (go-gitea#37575)
  refactor: remove obsolete export (go-gitea#37579)
  fix: Invalid UTF-8 commit messages in JSON API responses (go-gitea#37542)
  fix: use consistent GetUser family functions (go-gitea#37553)
  fix(api): return 409 message instead of empty JSON for wrong commit id (go-gitea#37572)
  fix(actions): prevent panic when workflow contains null jobs (go-gitea#37570)
  [skip ci] Updated translations via Crowdin

# Conflicts:
#	services/pull/pull.go
zjjhot added a commit to zjjhot/gitea that referenced this pull request May 8, 2026
* main:
  chore(deps): bump tool deps and pin, update `golangci-lint` (go-gitea#37574)
  build: update pnpm to v11 (go-gitea#37591)
  chore(renovate): detect Makefile tools, enable `go` bumps (go-gitea#37595)
  refactor: only reset a database table when the table's data was changed (go-gitea#37573)
  refactor: lint bare `fill`/`stroke` colors, add vars for git graph color series (go-gitea#37543)
  fix(actions): report individual step status in workflow job API response (go-gitea#37592)
  ci: allow `chore` type in PR title lint (go-gitea#37575)
  refactor: remove obsolete export (go-gitea#37579)
  fix: Invalid UTF-8 commit messages in JSON API responses (go-gitea#37542)
  fix: use consistent GetUser family functions (go-gitea#37553)
  fix(api): return 409 message instead of empty JSON for wrong commit id (go-gitea#37572)
  fix(actions): prevent panic when workflow contains null jobs (go-gitea#37570)
  [skip ci] Updated translations via Crowdin
  refactor: use modernc sqlite driver as default (go-gitea#37562)
  refactor(templates): remove ctxData from tmpl files, use ctx.RootData instead (go-gitea#37567)
  ci: increase renovate frequency and fix RENOVATE_ALLOWED_POST_UPGRADE_COMMANDS (go-gitea#37565)

# Conflicts:
#	models/user/user.go
silverwind added a commit to mohammad-rj/gitea that referenced this pull request May 8, 2026
* origin/main: (82 commits)
  build(deps): bump fast-uri from 3.1.0 to 3.1.2 (go-gitea#37616)
  fix: make clone URL respect public URL detection setting (go-gitea#37615)
  chore(deps): bump go-git/go-git/v5 to 5.19.0 (go-gitea#37608)
  chore(deps): update action dependencies (go-gitea#37603)
  fix(actions): fix blank lines after `::endgroup::` (go-gitea#37597)
  fix: treat email addresses case-insensitively (go-gitea#37600)
  fix(git): Fix smart http request scope bug (go-gitea#37583)
  chore(deps): update dependency go to v1.26.3 (go-gitea#37601)
  chore(deps): bump tool deps and pin, update `golangci-lint` (go-gitea#37574)
  build: update pnpm to v11 (go-gitea#37591)
  chore(renovate): detect Makefile tools, enable `go` bumps (go-gitea#37595)
  refactor: only reset a database table when the table's data was changed (go-gitea#37573)
  refactor: lint bare `fill`/`stroke` colors, add vars for git graph color series (go-gitea#37543)
  fix(actions): report individual step status in workflow job API response (go-gitea#37592)
  ci: allow `chore` type in PR title lint (go-gitea#37575)
  refactor: remove obsolete export (go-gitea#37579)
  fix: Invalid UTF-8 commit messages in JSON API responses (go-gitea#37542)
  fix: use consistent GetUser family functions (go-gitea#37553)
  fix(api): return 409 message instead of empty JSON for wrong commit id (go-gitea#37572)
  fix(actions): prevent panic when workflow contains null jobs (go-gitea#37570)
  ...

# Conflicts:
#	tests/e2e/events.test.ts
#	tests/integration/eventsource_test.go
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. topic/code-linting

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants