Skip to content

Commit d470365

Browse files
Ensure equal height on Carousel parent node as it's image content (#1340)
* Ensure equal height on Carousel parent node as it's image content * Ignore autogenerate vite file * Remove autogenerate file
1 parent 3a8a480 commit d470365

File tree

5 files changed

+23
-4
lines changed

5 files changed

+23
-4
lines changed

.changeset/spotty-wings-tease.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@obosbbl/grunnmuren-react": patch
3+
---
4+
5+
Fixes a layout bug in `<Hero variant="full-bleed">` that causes content below it to be placed behind `<Carousel>` children.

biome.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"dist/",
66
".next/",
77
".output/",
8-
".vinxi/",
8+
"vite.config.timestamp_*",
99
"apps/docs/public/storybook",
1010
"routetree.gen.ts",
1111
"packages/icons-react/src",

packages/react/src/button/button.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ function Button({ ref = null, ...props }: ButtonProps) {
186186
return isLinkProps(restProps) ? (
187187
<RACLink
188188
{...restProps}
189+
routerOptions={restProps.routerOptions}
189190
className={className}
190191
ref={ref as Ref<HTMLAnchorElement>}
191192
>

packages/react/src/hero/hero.stories.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,5 +266,15 @@ export const FullBleedWithCarousel = () => (
266266
</CarouselItems>
267267
</Carousel>
268268
</Hero>
269+
<h2>Tittel</h2>
270+
<p>
271+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod
272+
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
273+
veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea
274+
commodo consequat. Duis aute irure dolor in reprehenderit in voluptate
275+
velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat
276+
cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id
277+
est laborum.
278+
</p>
269279
</main>
270280
);

packages/react/src/hero/hero.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,15 @@ const variants = cva({
4949
standard: [roundedMediaCorners, oneColumnLayout],
5050
'full-bleed': [
5151
oneColumnLayout,
52-
// Match the heights of the <Media> wrapper for the Media content (e.g. image, VideoLoop, video etc.)
53-
// biome-ignore lint/nursery/useSortedClasses: biome is unable to sort the custom classes for 3xl and 4xl breakpoints
54-
'*:data-[slot="media"]:*:h-70 sm:*:data-[slot="media"]:*:h-[25rem] md:*:data-[slot="media"]:*:h-[30rem] lg:*:data-[slot="media"]:*:h-[35rem] xl:*:data-[slot="media"]:*:h-[40rem] 2xl:*:data-[slot="media"]:*:h-[42rem] 3xl:*:data-[slot="media"]:*:h-[48rem] 4xl:*:data-[slot="media"]:*:h-[53rem]',
5552
// Position the media and carousel content to fill the entire viewport width
5653
'*:data-[slot="media"]:*:absolute *:data-[slot="media"]:*:left-0',
5754
'*:data-[slot="carousel"]:*:absolute *:data-[slot="carousel"]:*:left-0',
55+
// Match the heights of the <Media> or <Carousel> wrapper for the Media content (e.g. image, VideoLoop, video etc.)
56+
// This is necessary due to the absolute positioning of the media and carousel containers in this variant
57+
// biome-ignore lint/nursery/useSortedClasses: biome is unable to sort the custom classes for 3xl and 4xl breakpoints
58+
'*:data-[slot="media"]:*:h-70 sm:*:data-[slot="media"]:*:h-[25rem] md:*:data-[slot="media"]:*:h-[30rem] lg:*:data-[slot="media"]:*:h-[35rem] xl:*:data-[slot="media"]:*:h-[40rem] 2xl:*:data-[slot="media"]:*:h-[42rem] 3xl:*:data-[slot="media"]:*:h-[48rem] 4xl:*:data-[slot="media"]:*:h-[53rem]',
59+
// biome-ignore lint/nursery/useSortedClasses: biome is unable to sort the custom classes for 3xl and 4xl breakpoints
60+
'*:data-[slot="carousel"]:h-70 sm:*:data-[slot="carousel"]:h-[25rem] md:*:data-[slot="carousel"]:h-[30rem] lg:*:data-[slot="carousel"]:h-[35rem] xl:*:data-[slot="carousel"]:h-[40rem] 2xl:*:data-[slot="carousel"]:h-[42rem] 3xl:*:data-[slot="carousel"]:h-[48rem] 4xl:*:data-[slot="carousel"]:h-[53rem]',
5861
'**:data-[slot="carousel-controls"]:container **:data-[slot="carousel-controls"]:right-0 **:data-[slot="carousel-controls"]:bottom-4 **:data-[slot="carousel-controls"]:left-0 **:data-[slot="carousel-controls"]:justify-end',
5962
// Override rounded corners of Carousel slots
6063
'*:data-[slot="carousel"]:*:rounded-none',

0 commit comments

Comments
 (0)