Skip to content

Commit 9aeb6e4

Browse files
committed
fix: carousel start slide width
1 parent 006c10b commit 9aeb6e4

File tree

11 files changed

+300
-242
lines changed

11 files changed

+300
-242
lines changed

apps/component-tests/src/global.css

Lines changed: 210 additions & 150 deletions
Large diffs are not rendered by default.

apps/website/src/global.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@layer qwik-ui, popover-polyfill, theme, base, components, utilities;
1+
@layer base, qwik-ui, popover-polyfill, theme, components, utilities;
22
@import 'tailwindcss';
33
@import 'tw-animate-css';
44

Lines changed: 77 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -1,143 +1,141 @@
11
export const api = {
2-
carousel: [
2+
"carousel": [
33
{
4-
bullet: [],
4+
"bullet": []
55
},
66
{
7-
inline: [],
7+
"inline": []
88
},
99
{
10-
next: [],
10+
"next": []
1111
},
1212
{
13-
pagination: [],
13+
"pagination": []
1414
},
1515
{
16-
player: [],
16+
"player": []
1717
},
1818
{
19-
previous: [],
19+
"previous": []
2020
},
2121
{
22-
root: [
22+
"root": [
2323
{
24-
PublicCarouselRootProps: [
24+
"PublicCarouselRootProps": [
2525
{
26-
comment: 'The gap between slides',
27-
prop: 'gap',
28-
type: 'number',
26+
"comment": "The gap between slides",
27+
"prop": "gap",
28+
"type": "number"
2929
},
3030
{
31-
comment: 'Number of slides to show at once',
32-
prop: 'slidesPerView',
33-
type: 'number',
31+
"comment": "Number of slides to show at once",
32+
"prop": "slidesPerView",
33+
"type": "number"
3434
},
3535
{
36-
comment: 'Whether the carousel is draggable',
37-
prop: 'draggable',
38-
type: 'boolean',
36+
"comment": "Whether the carousel is draggable",
37+
"prop": "draggable",
38+
"type": "boolean"
3939
},
4040
{
41-
comment: 'Alignment of slides within the viewport',
42-
prop: 'align',
43-
type: "'start' | 'center' | 'end'",
41+
"comment": "Alignment of slides within the viewport",
42+
"prop": "align",
43+
"type": "'start' | 'center' | 'end'"
4444
},
4545
{
46-
comment: 'Whether the carousel should rewind',
47-
prop: 'rewind',
48-
type: 'boolean',
46+
"comment": "Whether the carousel should rewind",
47+
"prop": "rewind",
48+
"type": "boolean"
4949
},
5050
{
51-
comment: 'Bind the selected index to a signal',
52-
prop: "'bind:selectedIndex'",
53-
type: 'Signal<number>',
51+
"comment": "Bind the selected index to a signal",
52+
"prop": "'bind:selectedIndex'",
53+
"type": "Signal<number>"
5454
},
5555
{
56-
comment: 'change the initial index of the carousel on render',
57-
prop: 'startIndex',
58-
type: 'number',
56+
"comment": "change the initial index of the carousel on render",
57+
"prop": "startIndex",
58+
"type": "number"
5959
},
6060
{
61-
comment:
62-
'@deprecated Use bind:selectedIndex instead\n Bind the current slide index to a signal',
63-
prop: "'bind:currSlideIndex'",
64-
type: 'Signal<number>',
61+
"comment": "@deprecated Use bind:selectedIndex instead\n Bind the current slide index to a signal",
62+
"prop": "'bind:currSlideIndex'",
63+
"type": "Signal<number>"
6564
},
6665
{
67-
comment: 'Whether the carousel should autoplay',
68-
prop: "'bind:autoplay'",
69-
type: 'Signal<boolean>',
66+
"comment": "Whether the carousel should autoplay",
67+
"prop": "'bind:autoplay'",
68+
"type": "Signal<boolean>"
7069
},
7170
{
72-
comment: 'the current progress of the carousel',
73-
prop: "'bind:progress'",
74-
type: 'Signal<number>',
71+
"comment": "the current progress of the carousel",
72+
"prop": "'bind:progress'",
73+
"type": "Signal<number>"
7574
},
7675
{
77-
comment: 'Time in milliseconds before the next slide plays during autoplay',
78-
prop: 'autoPlayIntervalMs',
79-
type: 'number',
76+
"comment": "Time in milliseconds before the next slide plays during autoplay",
77+
"prop": "autoPlayIntervalMs",
78+
"type": "number"
8079
},
8180
{
82-
comment: '@internal Total number of slides',
83-
prop: '_numSlides',
84-
type: 'number',
81+
"comment": "@internal Total number of slides",
82+
"prop": "_numSlides",
83+
"type": "number"
8584
},
8685
{
87-
comment: '@internal Whether this carousel has a title',
88-
prop: '_isTitle',
89-
type: 'boolean',
86+
"comment": "@internal Whether this carousel has a title",
87+
"prop": "_isTitle",
88+
"type": "boolean"
9089
},
9190
{
92-
comment: 'The sensitivity of the carousel dragging',
93-
prop: 'sensitivity',
94-
type: '{\n mouse?: number;\n touch?: number;\n }',
91+
"comment": "The sensitivity of the carousel dragging",
92+
"prop": "sensitivity",
93+
"type": "{\n mouse?: number;\n touch?: number;\n }"
9594
},
9695
{
97-
comment:
98-
'The amount of slides to move when hitting the next or previous button',
99-
prop: 'move',
100-
type: 'number',
96+
"comment": "The amount of slides to move when hitting the next or previous button",
97+
"prop": "move",
98+
"type": "number"
10199
},
102100
{
103-
comment: "The carousel's direction",
104-
prop: 'orientation',
105-
type: "'horizontal' | 'vertical'",
101+
"comment": "The carousel's direction",
102+
"prop": "orientation",
103+
"type": "'horizontal' | 'vertical'"
106104
},
107105
{
108-
comment: 'The maximum height of the slides. Needed in vertical carousels',
109-
prop: 'maxSlideHeight',
110-
type: 'number',
106+
"comment": "The maximum height of the slides. Needed in vertical carousels",
107+
"prop": "maxSlideHeight",
108+
"type": "number"
111109
},
112110
{
113-
comment: 'Whether the carousel should support mousewheel navigation',
114-
prop: 'mousewheel',
115-
type: 'boolean',
116-
},
117-
],
118-
},
119-
],
111+
"comment": "Whether the carousel should support mousewheel navigation",
112+
"prop": "mousewheel",
113+
"type": "boolean"
114+
}
115+
]
116+
}
117+
]
120118
},
121119
{
122-
scroller: [],
120+
"scroller": []
123121
},
124122
{
125-
slide: [],
123+
"slide": []
126124
},
127125
{
128-
step: [],
126+
"step": []
129127
},
130128
{
131-
stepper: [],
129+
"stepper": []
132130
},
133131
{
134-
title: [],
132+
"title": []
135133
},
136134
{
137-
'use-carousel': [],
135+
"use-carousel": []
138136
},
139137
{
140-
'use-scroller': [],
141-
},
142-
],
143-
};
138+
"use-scroller": []
139+
}
140+
]
141+
};

apps/website/src/routes/docs/styled/(getting-started)/install/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Click on "make it yours" -> choose your favorite color theme and style -> copy/p
4545
Here's an example:
4646

4747
```css
48-
@layer qwik-ui, popover-polyfill, theme, base, components, utilities;
48+
@layer base, qwik-ui, popover-polyfill, theme, components, utilities;
4949
@import 'tailwindcss';
5050
@import 'tw-animate-css';
5151

apps/website/src/routes/docs/styled/(guides)/tailwind-3-migration/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ If you are using custom colors, you might need to use @theme inline instead of @
3636
Here is an example of the css config:
3737

3838
```css
39-
@layer qwik-ui, popover-polyfill, theme, base, components, utilities;
39+
@layer base, qwik-ui, popover-polyfill, theme, components, utilities;
4040
@import 'tailwindcss';
4141
@import 'tw-animate-css';
4242

apps/website/src/routes/docs/styled/menu.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515

1616
## Components
1717

18-
- [Missing a component?](/docs/styled/missing)
1918
- [Accordion](/docs/styled/accordion)
2019
- [Alert](/docs/styled/alert)
2120
- [Avatar](/docs/styled/avatar)

packages/cli/src/generators/setup-tailwind/setup-tailwind-generator.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ describe('Setup Tailwind generator', () => {
2828
const updatedGlobalCssContent = tree.read('src/global.css', 'utf-8');
2929

3030
expect(updatedGlobalCssContent).toMatchInlineSnapshot(`
31-
"@layer qwik-ui, popover-polyfill, theme, base, components, utilities;
31+
"@layer base, qwik-ui, popover-polyfill, theme, components, utilities;
3232
@import 'tailwindcss';
3333
@import 'tw-animate-css';
3434
@@ -219,7 +219,7 @@ describe('Setup Tailwind generator', () => {
219219
const updatedGlobalCssContent = tree.read('src/global.css', 'utf-8');
220220

221221
expect(updatedGlobalCssContent).toMatchInlineSnapshot(`
222-
"@layer qwik-ui, popover-polyfill, theme, base, components, utilities;
222+
"@layer base, qwik-ui, popover-polyfill, theme, components, utilities;
223223
@import 'tailwindcss';
224224
@import 'tw-animate-css';
225225

packages/kit-headless/src/components/carousel/root.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ export const CarouselBase = component$((props: PublicCarouselRootProps) => {
198198
'--scroll-snap-align': alignSig.value,
199199
'--orientation': orientationSig.value === 'vertical' ? 'column' : 'row',
200200
'--max-slide-height': `${maxSlideHeightSig.value}px`,
201+
// '--remove-flex-gap': `-${gapSig.value - 1}px`,
201202
}}
202203
>
203204
<Slot />

packages/kit-styled/src/templates/global.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@layer qwik-ui, popover-polyfill, theme, base, components, utilities;
1+
@layer base, qwik-ui, popover-polyfill, theme, components, utilities;
22
@import 'tailwindcss';
33
@import 'tw-animate-css';
44

packages/utils/src/theme/extract-theme-css.spec.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ describe('Extract theme from css', () => {
3232
const theme = extractThemeCSS(inputThemeString, exampleRootCssContent);
3333

3434
expect(theme).toMatchInlineSnapshot(`
35-
"@layer qwik-ui, popover-polyfill, theme, base, components, utilities;
35+
"@layer base, qwik-ui, popover-polyfill, theme, components, utilities;
3636
@import 'tailwindcss';
3737
@import 'tw-animate-css';
3838
@@ -208,7 +208,7 @@ describe('Extract theme from css', () => {
208208
themeStringInEveryOrder.forEach((themeString) => {
209209
const theme = extractThemeCSS(themeString, exampleRootCssContent);
210210
expect(theme).toMatchInlineSnapshot(`
211-
"@layer qwik-ui, popover-polyfill, theme, base, components, utilities;
211+
"@layer base, qwik-ui, popover-polyfill, theme, components, utilities;
212212
@import 'tailwindcss';
213213
@import 'tw-animate-css';
214214
@@ -380,7 +380,7 @@ test(`GIVEN theme string is 'brutalist base-stone primary-pink-700 border-radius
380380
const theme = extractThemeCSS(inputThemeString, exampleRootCssContent);
381381

382382
expect(theme).toMatchInlineSnapshot(`
383-
"@layer qwik-ui, popover-polyfill, theme, base, components, utilities;
383+
"@layer base, qwik-ui, popover-polyfill, theme, components, utilities;
384384
@import 'tailwindcss';
385385
@import 'tw-animate-css';
386386
@@ -556,7 +556,7 @@ test(`GIVEN primary color is "pink-700",
556556
themeStringInEveryOrder.forEach((themeString) => {
557557
const theme = extractThemeCSS(themeString, exampleRootCssContent);
558558
expect(theme).toMatchInlineSnapshot(`
559-
"@layer qwik-ui, popover-polyfill, theme, base, components, utilities;
559+
"@layer base, qwik-ui, popover-polyfill, theme, components, utilities;
560560
@import 'tailwindcss';
561561
@import 'tw-animate-css';
562562
@@ -721,7 +721,7 @@ test(`GIVEN primary color is "pink-700",
721721
});
722722

723723
const exampleRootCssContent = `
724-
@layer qwik-ui, popover-polyfill, theme, base, components, utilities;
724+
@layer base, qwik-ui, popover-polyfill, theme, components, utilities;
725725
@import 'tailwindcss';
726726
@import 'tw-animate-css';
727727

0 commit comments

Comments
 (0)