feat: region.js - Proposal for flag unwrapped accepting boolean truthy input#338
Open
34638a wants to merge 2 commits intobigcommerce:masterfrom
Open
feat: region.js - Proposal for flag unwrapped accepting boolean truthy input#33834638a wants to merge 2 commits intobigcommerce:masterfrom
unwrapped accepting boolean truthy input#33834638a wants to merge 2 commits intobigcommerce:masterfrom
Conversation
Added proposal parameters for a variance in the return state of the region block helper. `empty`: When the `empty` flag is truthy, if there is no content currently available for the named region; then return a empty string instead of the normal div wrapper. `raw`: When the `raw` flag is truthy, omit the normal div wrapper when returning the region content.
empty and rawempty and raw
… preserved. Add Test Cases for new unwrapped state.
empty and rawunwrapped accepting boolean truthy input
Contributor
Author
|
Hi @jairo-bc Please enjoy another PR for consideration.
|
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.
Proposal for flag to disable default
divwrapping behaviour forregionhandlebars 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-5region because the content is empty.Context, anything within the
templatehtml 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