Repository navigation
refactor(gallery): migrate to modular theming - #31612
Open
brandyscarney wants to merge 3 commits into
Open
brandyscarney wants to merge 3 commits into
brandyscarney wants to merge 3 commits into
Conversation
brandyscarney
added this pull request to stack #31613
October 20, 2026 19:28
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
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.
Issue number: internal
What is the current behavior?
ion-galleryreads the theme and adds it as a class on its host, and its gap is hardcoded to16pxin both thegapprop default and the stylesheet, so a theme can't change it.What is the new behavior?
ion-galleryto Modular Ionic: removes thethemevirtual prop and the theme class on the host.IonGalleryRecipewith agaptoken, exposed as--ion-gallery-gap. The ionic, ios and md themes set it tovar(--ion-spacing-lg)(16px), so the default gap doesn't change.gapno longer defaults to'16px'. When it's unset, invalid, or a breakpoint map leaves out the active breakpoint, the gallery uses the theme's gap. Agapvalue still overrides the theme.16pxfallbacks on--internal-gallery-gapingallery.scssandgallery-item.scss, so masonry items also use the theme's gap for the space between stacked items.gallery-interface.tstogallery.interface.tsandgallery-constants.tstogallery.constant.ts, and renames the exported types toIonGalleryColumns,IonGalleryGapandIonGalleryBreakpointValues.DEFAULT_GAPis removed.gapis unset, for breakpoints agapmap doesn't set, and in each theme.Does this introduce a breaking change?
ion-galleryhasn't been in a release yet, so removingtheme, renaming the types and changing thegapdefault aren't breaking.Other information
ion-gallery-itemhas no recipe because its stylesheet only has layout rules. The masonry spacing between its items comes from the gallery's gap.How to test
16pxgap between tiles should match.<figure>line up with the others and keep the same size and gap.document.querySelector('ion-gallery').style.setProperty('--ion-gallery-gap', '40px'). The gap on the first gallery should grow to40px.Swap
ionic:themeandionic:modetoiosormdto check the other themes.