reiern70 opened a new issue, #1638:
URL: https://github.com/apache/wicket/issues/1638
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.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]