feat(conf): appCSSPath and appFrameCSSPath, drop dead pageCSSPath - #6
Merged
Merged
Conversation
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({}).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
customCSSPathin the project settings.Added
Two
ConfOptionsoptions, each taking a single URL or a list of them:appFrameCSSPathappCSSPath<head>of the app documentBoth load after the widget's own stylesheet, so the integrator's rules win.
appCSSPathstacks on the project'scustomCSSPathand, like it, applies only on a plan that allows appearance customization.Removed — BC break
pageCSSPath. The widget read the key ingetConf()but nothing ever consumed it, and CSS for the host page goes in the integrator's own document anyway.Callers passing
ConfOptionsarguments positionally must drop the third argument. Named arguments only lose the key.Fixed
JSON_FORCE_OBJECTturned every list into{"0": …}, soappCSSPath: ['a.css', 'b.css']would have arrived as an object and been rejected. Threadattributeswere 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 asconf({}).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) andcomposer ca(PHPStan + php-cs-fixer) pass. New cases cover single vs. list values, the array rendering in the generated code, andconf({})for empty options.