feat: region.js - Proposal for flag unwrapped
accepting boolean truthy input
#338
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.
Proposal for flag to disable default
div
wrapping behaviour forregion
handlebars object when the injected content is or is not present. This flag is a modifier is proposed for the purpose of allowing post render processes to recognise the non-existence of content and act accordingly, without additional processing requirements in handlebars or on client.For example, with the flag, CSS can be constructed with a parent container to dynamically reframe the region container and adjust accordingly all on client without JS. In the below example screenshot, you will be able to see how the content appears when the implied action based off the CSS is to not display the
child-5
region because the content is empty.Context, anything within the
template
html tag below represents data created within the current theme editor for a given region: (note only regions child-1 to child-3 have content provided by the editor utility)Template
Rendered Output
cc @bigcommerce/storefront-team