-
Notifications
You must be signed in to change notification settings - Fork 13.4k
feat(gallery): add new gallery component #31101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
brandyscarney
wants to merge
13
commits into
next
Choose a base branch
from
FW-7280
base: next
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
b0a3f1a
feat(gallery): add new gallery component
brandyscarney 74332ac
style(core): add TODOs for migrating global breakpoints
brandyscarney cca764d
test(gallery): add spec test for columns property
brandyscarney ad2d0a2
refactor(gallery): convert columns css variable to an internal variable
brandyscarney 6a19314
test(gallery): add basic e2e test
brandyscarney fdd55c4
chore(): add updated snapshots
brandyscarney e9cdc62
test(gallery): add layout e2e test
brandyscarney f865311
chore(): add updated snapshots
brandyscarney ca9305e
refactor(gallery): move types to separate file
brandyscarney 8e9c9b0
test(gallery): add spec tests for layout and order
brandyscarney 576c569
style: lint
brandyscarney f40ea8b
chore: pass non-snapshot images to Vercel
brandyscarney 970e4f2
Merge branch 'next' into FW-7280
brandyscarney File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,2 @@ | ||
| core/src/components/**/*/*.png | ||
| # Exclude visual-regression snapshot artifacts only | ||
| core/src/**/*-snapshots/*.png |
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| export interface GalleryBreakpointColumns { | ||
| xs?: string | number; | ||
| sm?: string | number; | ||
| md?: string | number; | ||
| lg?: string | number; | ||
| xl?: string | number; | ||
| xxl?: string | number; | ||
| } | ||
|
|
||
| export type GalleryColumns = GalleryBreakpointColumns | string | number; |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| :host { | ||
| /** | ||
| * @prop --ion-gallery-gap: Space between gallery items | ||
| */ | ||
| display: grid; | ||
| grid-template-columns: repeat(var(--internal-gallery-columns, 2), minmax(0, 1fr)); | ||
| } | ||
|
|
||
| // Layout: Uniform | ||
| // -------------------------------------------------- | ||
|
|
||
| :host(.gallery-layout-uniform) { | ||
| gap: var(--ion-gallery-gap, 16px); | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Gap currently can only be changed by CSS. Should this be a property that can be updated based on breakpoint, like |
||
| } | ||
|
|
||
| // Target all slotted elements in the uniform layout. This ensures that nested | ||
| // images also have an aspect ratio of 1/1. | ||
| :host(.gallery-layout-uniform) ::slotted(*) { | ||
| aspect-ratio: 1/1; | ||
| } | ||
|
|
||
| // Layout: Masonry | ||
| // -------------------------------------------------- | ||
|
|
||
| :host(.gallery-layout-masonry) { | ||
| align-items: start; | ||
|
|
||
| column-gap: var(--ion-gallery-gap, 16px); | ||
| row-gap: 0; | ||
|
|
||
| grid-auto-rows: 2px; | ||
| } | ||
|
|
||
| :host(.gallery-layout-masonry) ::slotted(*) { | ||
| display: block; | ||
|
|
||
| // Clear min-height so items size to their content | ||
| min-height: unset; | ||
|
|
||
| margin-bottom: var(--ion-gallery-gap, 16px); | ||
| } | ||
|
|
||
| // Slotted elements | ||
| // -------------------------------------------------- | ||
|
|
||
| ::slotted(*) { | ||
| width: 100%; | ||
| } | ||
|
|
||
| ::slotted(img) { | ||
| display: block; | ||
|
|
||
| object-fit: cover; | ||
| object-position: center; | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated this because this rule prevented the images in my
assets/directory from being served on Vercel.