Skip to content

feat(conf): appCSSPath and appFrameCSSPath, drop dead pageCSSPath - #6

Merged
stromcom merged 1 commit into
masterfrom
feat/app-css-paths
Sep 11, 2026
Merged

stromcom merged 1 commit into
masterfrom
feat/app-css-paths

Conversation

@stromcom

Copy link
Copy Markdown
Owner

Follows the widget-side change in www.stromcom.cz#101.

Why

The widget renders into a shadow root and the app runs in an iframe. Neither is reachable from the host page's stylesheet, so an integrator had no way to restyle the widget beyond customCSSPath in the project settings.

Added

Two ConfOptions options, each taking a single URL or a list of them:

Option Where it lands Covers
appFrameCSSPath shadow root of the mount point container, backdrop, the iframe element
appCSSPath <head> of the app document the whole UI inside the widget

Both load after the widget's own stylesheet, so the integrator's rules win. appCSSPath stacks on the project's customCSSPath and, like it, applies only on a plan that allows appearance customization.

Removed — BC break

pageCSSPath. The widget read the key in getConf() but nothing ever consumed it, and CSS for the host page goes in the integrator's own document anyway.

Callers passing ConfOptions arguments positionally must drop the third argument. Named arguments only lose the key.

Fixed

JSON_FORCE_OBJECT turned every list into {"0": …}, so appCSSPath: ['a.css', 'b.css'] would have arrived as an object and been rejected. Thread attributes were hit by the same bug — the snippet validates them as an array and logged an error instead. Lists now stay arrays; an empty option set still renders as conf({}).

Release

Changelog is cut as 0.6.0 (minor, because of the removal — the package is pre-1.0). Tag once merged.

Tests

composer test (146 tests) and composer ca (PHPStan + php-cs-fixer) pass. New cases cover single vs. list values, the array rendering in the generated code, and conf({}) for empty options.

The widget renders into a shadow root and the app runs in an iframe, so neither
could be styled from the host page. Two new options open them up, each taking a
single URL or a list:

- appFrameCSSPath — shadow root of the mount point (container, backdrop, iframe)
- appCSSPath — document of the app itself, on top of the project's customCSSPath

pageCSSPath is gone. The widget read the key but nothing consumed it, and CSS for
the host page belongs in the integrator's own document. Positional callers must
drop the third argument.

Lists are no longer serialized as JSON objects — JSON_FORCE_OBJECT turned them
into {"0": …}, which the widget rejects. Thread attributes were hit by the same
bug. An empty option set still renders as conf({}).
@stromcom
stromcom merged commit 42a5d8d into master Sep 11, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant