Add color themes shared by the components of wicket-extensions

Aperta
#1,638 0 commenti 0 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@reiern70 ci sta già lavorando.

Dal 2/10/2026.

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

The components of wicket-extensions each bring their own style sheet with their own hard-coded colors. An application that wants its tables, progress bars and panels to match its look has to override every style sheet separately, and has no way to give one part of a page a different look from another.

This proposes shared color themes, in a new package org.apache.wicket.extensions.theme:

  • Properties: the colors are defined once, as CSS custom properties named --wicket-theme-* (primary, primary-dark, on-primary, accent, text, surface, surface-alt, hover, selected, highlight, toolbar, border, progress, progress-dark, track, color-scheme). The style sheets of the components read them.
  • Themes: a theme is a CSS class setting the properties. Theme ships DEFAULT, BLUE, RED, GREY and GREEN; Theme.CSS is the style sheet defining them. An application defines a theme of its own as a CSS class setting the same properties.
  • ThemeBehavior: puts a theme's class on a component and contributes the style sheet. On the page, the theme applies to every themable component inside it; on a single component, only to that one. The theme comes from a model, so re-rendering the component switches it, for example via Ajax from a drop-down.
  • Form controls: --wicket-theme-color-scheme sets the color scheme of the text fields, selects and check boxes inside themed components, so they match the theme even on a page that declares color-scheme: light dark and is shown in dark mode.
  • Content Security Policy: themes are switched by CSS class only and need no inline style, so they work under a strict CSP.
  • Compatibility: components read the properties only inside a theme, so a component without a theme looks as it does without this change.

Components using it: the DynamicDataTable (header, rows, toolbars, resize handles), the ProgressBar (#1635) and the CollapsiblePanel (#1636). The examples get a theme drop-down on their pages.

Lingua principale
Java
Stelle
800
Fork
437
Merge medio
21h 36m
PR unite (30g)
167

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di apache/wicket

Tutte le issue di apache/wicket

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.