-
-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ScrollArea] Remove
gutter
prop (#1023)
- Loading branch information
Showing
11 changed files
with
78 additions
and
338 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
docs/src/app/(private)/experiments/scroll-area-inset.module.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
.Root { | ||
width: 300px; | ||
height: 300px; | ||
--scrollbar-size: 20px; | ||
} | ||
|
||
.Viewport { | ||
width: 100%; | ||
height: 100%; | ||
} | ||
|
||
.Content { | ||
width: 600px; | ||
height: 600px; | ||
padding-inline-end: var(--scrollbar-size); | ||
padding-bottom: var(--scrollbar-size); | ||
} | ||
|
||
.Scrollbar { | ||
background: lightgray; | ||
|
||
&[data-orientation='vertical'] { | ||
width: var(--scrollbar-size); | ||
} | ||
|
||
&[data-orientation='horizontal'] { | ||
height: var(--scrollbar-size); | ||
} | ||
} | ||
|
||
.Thumb { | ||
background: black; | ||
|
||
&[data-orientation='vertical'] { | ||
width: var(--scrollbar-size); | ||
} | ||
|
||
&[data-orientation='horizontal'] { | ||
height: var(--scrollbar-size); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import * as React from 'react'; | ||
import { ScrollArea } from '@base-ui-components/react/scroll-area'; | ||
import styles from './scroll-area-inset.module.css'; | ||
|
||
export default function ScrollAreaInset() { | ||
return ( | ||
<div> | ||
<p> | ||
Scroll content is not clipped by inset scrollbars (user-defined paddings) | ||
</p> | ||
<ScrollArea.Root className={styles.Root}> | ||
<ScrollArea.Viewport className={styles.Viewport}> | ||
<div className={styles.Content}> | ||
<p> | ||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod | ||
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim | ||
veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea | ||
commodo consequat. Duis aute irure dolor in reprehenderit in voluptate | ||
velit esse cillum dolore eu fugiat nulla pariatur. | ||
</p> | ||
</div> | ||
</ScrollArea.Viewport> | ||
<ScrollArea.Scrollbar className={styles.Scrollbar} orientation="vertical"> | ||
<ScrollArea.Thumb className={styles.Thumb} /> | ||
</ScrollArea.Scrollbar> | ||
<ScrollArea.Scrollbar className={styles.Scrollbar} orientation="horizontal"> | ||
<ScrollArea.Thumb className={styles.Thumb} /> | ||
</ScrollArea.Scrollbar> | ||
<ScrollArea.Corner /> | ||
</ScrollArea.Root> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.