Enhance: Added toggle to apply styling in Lightbox conditionally#67596
Enhance: Added toggle to apply styling in Lightbox conditionally#67596Mayank-Tripathi32 wants to merge 1 commit intoWordPress:trunkfrom
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
| icon={ formatIndent } | ||
| label={ __( 'Apply Custom Styles to lightbox' ) } | ||
| onClick={ toggleStylingLightbox } | ||
| isActive={ lightbox?.applyStyles ?? false } |
There was a problem hiding this comment.
In order to maintain existing functionality on existing block-enabled content, the default value should be true if applyStyles is not already available within the lightbox block settings.
Correct me if I'm wrong here in case the default value defined in block.json is used in this situation.
There was a problem hiding this comment.
Oh yes, I initially wrote the logic in reverse and then refactored it. I'll update it (though it won't make much of a difference since it defaults to true in block.json). It's fine to leave it as is. This is mainly for visual indication, and since the lightbox can be undefined when inactive, setting it to true might cause issues.
Attempt to resolve #67535, PR is aimed to explore the possibility.
What?
This PR introduces a toggle for the lightbox feature to conditionally apply styles.
Why?
Styles should only be applied within the site blocks and not inside the Lightbox. Since the Lightbox opens in a modal, there should be an option to disable custom site styles for it.
How?
Testing Instructions
Screenshots or screencast
demo.mp4