@latte-macchiat-io/latte-vanilla-components 0.0.323 → 0.0.324
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
@@ -7,6 +7,7 @@ import { themeContract } from '../../theme/contract.css';
|
|
7
7
|
|
8
8
|
import { generateResponsiveMedia } from '../../utils/generateResponsiveMedia';
|
9
9
|
import { generateResponsiveMediaCalc } from '../../utils/generateResponsiveMediaCalc';
|
10
|
+
import { mergeResponsiveMedias } from '../../utils/mergeResponsiveMedias';
|
10
11
|
|
11
12
|
export const carouselRecipe = recipe(
|
12
13
|
{
|
@@ -184,12 +185,12 @@ export const carouselBullets = style({
|
|
184
185
|
position: 'absolute',
|
185
186
|
justifyContent: 'center',
|
186
187
|
|
187
|
-
'@media':
|
188
|
-
|
188
|
+
'@media': mergeResponsiveMedias(
|
189
|
+
generateResponsiveMedia({
|
189
190
|
gap: themeContract.carousel.bullet.gap,
|
190
191
|
}),
|
191
|
-
|
192
|
-
|
192
|
+
generateResponsiveMediaCalc('top', '100%', themeContract.carousel.bullet.positionVerticalOffset, '+')
|
193
|
+
),
|
193
194
|
});
|
194
195
|
|
195
196
|
export const carouselBullet = style(
|
@@ -0,0 +1,21 @@
|
|
1
|
+
/**
|
2
|
+
* Fusionne plusieurs objets responsive générés pour Vanilla Extract
|
3
|
+
* sans écraser les valeurs existantes des mêmes breakpoints.
|
4
|
+
*
|
5
|
+
* Exemple :
|
6
|
+
* mergeResponsiveMedias(a, b) => combine les clés communes
|
7
|
+
*/
|
8
|
+
export function mergeResponsiveMedias(...mediaObjects: Record<string, Record<string, string>>[]): Record<string, Record<string, string>> {
|
9
|
+
const merged: Record<string, Record<string, string>> = {};
|
10
|
+
|
11
|
+
for (const obj of mediaObjects) {
|
12
|
+
for (const [query, styles] of Object.entries(obj)) {
|
13
|
+
merged[query] = {
|
14
|
+
...(merged[query] || {}),
|
15
|
+
...styles,
|
16
|
+
};
|
17
|
+
}
|
18
|
+
}
|
19
|
+
|
20
|
+
return merged;
|
21
|
+
}
|