Make widget theme overrides easier to merge across packages

Open
#130 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
php
Domain
frontend

Research direction

Start with the widgets-themes configuration group and compare the proposed extension behavior with yiisoft/form's ThemePath::BOOTSTRAP5_VERTICAL. Determine which supported mechanism preserves package defaults while allowing application overrides, then verify that a bootstrap5 customization no longer requires an application merge modifier or direct vendor-file loading.

Written by the indexing model from the issue text.

Description

Problem

Widget themes contributed by packages are merged through the widgets-themes configuration group. By default, nested arrays are replaced rather than recursively merged.

This makes a small application override unexpectedly replace the complete package theme definition. To preserve the package defaults, the application must either:

  • add a RecursiveMerge modifier to the application runner, or
  • manually load the vendor theme file and merge it with array_replace_recursive().

This differs from yiisoft/form, where the Bootstrap theme can be loaded and extended directly through ThemePath::BOOTSTRAP5_VERTICAL.

Proposal

Provide a supported helper or configuration mechanism for extending widget themes without requiring application-level merge modifiers or direct loading of vendor configuration files.

For example, widget theme groups could be recursively merged by default, or the package could expose a public theme extension API/path similar to yiisoft/form.

Context

This affects applications customizing the built-in bootstrap5 theme while retaining the package's other widget defaults.

Dominant language
PHP
Stars
25
Forks
5
Avg merge
46m
Merged PRs (30d)
1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from yiisoft/widget

All issues in yiisoft/widget

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.