Repository navigation
feat: section anchors, tabs opened from the URL, slider peek, gutter - #102
Merged
Merged
Conversation
Core: - A section can have an anchor (its id), set in the Advanced panel; the area render keeps the first of two equal ids. - #anchor-N opens the Nth tab or accordion panel, through a small public script linked only by pages with tabs or an accordion. - sliderPeek shows a sliver of the next slide. - content_blocks.section.gutter: an opt-in inline padding for every section, overridable with --cb-section-gutter. - A preset key extending a core key (anchorId) is no longer a typo. Kit: - Open in a new tab on card buttons, gallery links and the image link. - An image's fixed height per viewport (tablet, mobile). - A YouTube or Vimeo link pasted as a video file is refused.
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.
Core
anchorsetting, allowed in presets) becomes the section'sid. A pasted#is dropped and spaces become dashes; a value that cannot be an id is refused in the sidebar and checked again at render (import, presets and templates bypass the form). Two sections with the same anchor both render; the area render gives theidto the first one only. The builder'spatchSectionnow copies theid. Exposed assections[].anchorin the headless tree.#anchor-2opens the second tab or accordion panel of the section anchoredanchor(counted from 1). A panel's own id, or the id of anything inside a closed panel, works too, on load and onhashchange.assets/panels.jsis served by a new public route,content_blocks_asset_panels, and linked only by public pages with tabs or an accordion.sliderPeek): the slides narrow so that the start of the next one shows. The sliver is--cb-slide-peek(12% of the row by default). A slider without the option keeps its exact widths.content_blocks.section.gutter(a CSS length,nullby default) gives every section an inline padding. A section's own left/right padding still wins, and--cb-section-gutteroverrides it from the host's CSS. Opt-in, so no existing public page moves.anchorId), which the newanchorkey would otherwise have refused.Kit
newTab) on card buttons, gallery image links and the image block's link.Tests
panels.test.js), kit 70.section-anchor.spec.js(anchor + tab from the URL, refused anchor, slider peek). Main suite 263 and Encore suite 11 pass.