You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(gallery): support CSS variables being passed to gap (#31186)
## What is the current behavior?
The Gallery component currently only supports CSS length strings and numbers being passed to `gap`.
## What is the new behavior?
- Adds support for CSS variables being passed to `gap` as a string.
- Adds spec & e2e tests verifying the behavior.
---------
Co-authored-by: Brandy Smith <6577830+brandyscarney@users.noreply.github.com>
* The space between gallery items. Accepts valid CSS [length-percentage](https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Values/length-percentage) values like `16px`, `1rem`, `20%`, math functions like `calc(10px + 20%)`, or numbers (treated as pixel values). Can also be set as a breakpoint map (e.g. `{ xs: '8px', sm: '1rem', md: '24px' }`). Does not accept space-separated values or CSS keyword values like `inherit`, `auto`, etc.
1481
+
* The space between gallery items. Accepts valid CSS [length-percentage](https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Values/length-percentage) values like `16px`, `1rem`, `20%`, math functions like `calc(10px + 20%)`, CSS variables like `var(--app-gallery-gap)`, or numbers (treated as pixel values). Can also be set as a breakpoint map (e.g. `{ xs: '8px', sm: '1rem', md: '24px' }`). Does not accept space-separated values or CSS keyword values like `inherit`, `auto`, etc.
* The space between gallery items. Accepts valid CSS [length-percentage](https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Values/length-percentage) values like `16px`, `1rem`, `20%`, math functions like `calc(10px + 20%)`, or numbers (treated as pixel values). Can also be set as a breakpoint map (e.g. `{ xs: '8px', sm: '1rem', md: '24px' }`). Does not accept space-separated values or CSS keyword values like `inherit`, `auto`, etc.
7529
+
* The space between gallery items. Accepts valid CSS [length-percentage](https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Values/length-percentage) values like `16px`, `1rem`, `20%`, math functions like `calc(10px + 20%)`, CSS variables like `var(--app-gallery-gap)`, or numbers (treated as pixel values). Can also be set as a breakpoint map (e.g. `{ xs: '8px', sm: '1rem', md: '24px' }`). Does not accept space-separated values or CSS keyword values like `inherit`, `auto`, etc.
@@ -79,7 +79,8 @@ export class Gallery implements ComponentInterface {
79
79
/**
80
80
* The space between gallery items. Accepts valid CSS [length-percentage](https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Values/length-percentage)
81
81
* values like `16px`, `1rem`, `20%`, math functions like `calc(10px + 20%)`,
82
-
* or numbers (treated as pixel values). Can also be set as a breakpoint map
82
+
* CSS variables like `var(--app-gallery-gap)`, or numbers (treated as pixel
83
+
* values). Can also be set as a breakpoint map
83
84
* (e.g. `{ xs: '8px', sm: '1rem', md: '24px' }`). Does not accept
84
85
* space-separated values or CSS keyword values like `inherit`, `auto`, etc.
85
86
*/
@@ -201,9 +202,10 @@ export class Gallery implements ComponentInterface {
201
202
}
202
203
203
204
/**
204
-
* Normalize a single gap value (`gap` as a number, string, or one entry from
205
-
* a `gap` breakpoint map) to a CSS length string. Returns `undefined` when
206
-
* the input cannot be interpreted as a valid CSS length.
205
+
* Normalize a single gap value (`gap` as a number, a string such as a CSS
206
+
* length-percentage or `var()` reference, or one entry from a `gap`
207
+
* breakpoint map) to a CSS length string. Returns `undefined` when the
208
+
* input cannot be interpreted as a valid CSS length or `var()` reference.
0 commit comments