Examples
Grid template minmax() width customization
Grid template columms min value can be applied to .pf-v5-l-gallery
. Min-width is set inline as --pf-v5-l-gallery--GridTemplateColumns--min{-on-[breakpoint]}: {width}
.
Documentation
Overview
The gallery layout is designed so that all of its children are of uniform size, display horizontally, and wrap responsively.
Usage
Class | Applied to | Outcome |
---|---|---|
.pf-v5-l-gallery | <div> | Initializes a Gallery layout |
.pf-v5-l-gallery__item | <div> | Explicitly sets the child for the gallery. This class isn't necessary, but it is included to keep inline with BEM convention, and to provide an entity that will later be used for applying modifiers. |
.pf-m-gutter | .pf-v5-l-gallery | Adds space between children by using the globally defined gutter value. |
--pf-v5-l-gallery--GridTemplateColumns--min{-on-[breakpoint]}: {width} | .pf-v5-l-gallery | Modifies the min value of grid-template-columns declaration at the optional breakpoint. |
--pf-v5-l-gallery--GridTemplateColumns--max{-on-[breakpoint]}: {width} | .pf-v5-l-gallery | Modifies the max value of grid-template-columns declaration at the optional breakpoint. |
CSS variables
Expand or collapse column | Selector | Variable | Value | |
---|---|---|---|---|
.pf-v5-l-gallery | --pf-v5-l-gallery--m-gutter--GridGap | 1rem | ||
--pf-v5-l-gallery--m-gutter--GridGap --pf-v5-global--gutter $pf-v5-global--gutter $pf-v5-global--spacer--md pf-size-prem(16px) 1rem | ||||
.pf-v5-l-gallery | --pf-v5-l-gallery--GridTemplateColumns--min | 250px | ||
.pf-v5-l-gallery | --pf-v5-l-gallery--GridTemplateColumns--minmax--min | 250px | ||
--pf-v5-l-gallery--GridTemplateColumns--minmax--min --pf-v5-l-gallery--GridTemplateColumns--min 250px | ||||
.pf-v5-l-gallery | --pf-v5-l-gallery--GridTemplateColumns--max | 1fr | ||
.pf-v5-l-gallery | --pf-v5-l-gallery--GridTemplateColumns--minmax--max | 1fr | ||
--pf-v5-l-gallery--GridTemplateColumns--minmax--max --pf-v5-l-gallery--GridTemplateColumns--max 1fr | ||||
.pf-v5-l-gallery | --pf-v5-l-gallery--GridTemplateColumns | repeat(auto-fill, minmax(250px, 1fr)) | ||
--pf-v5-l-gallery--GridTemplateColumns repeat(auto-fill, minmax(--pf-v5-l-gallery--GridTemplateColumns--minmax--min, --pf-v5-l-gallery--GridTemplateColumns--minmax--max)) repeat(auto-fill, minmax(--pf-v5-l-gallery--GridTemplateColumns--min, --pf-v5-l-gallery--GridTemplateColumns--max)) repeat(auto-fill, minmax(250px, 1fr)) | ||||
.pf-v5-l-gallery | --pf-v5-l-gallery--GridTemplateRows | auto |
View source on GitHub