Open source website builder and Webflow alternative. Webstudio is an advanced visual builder that connects to any headless CMS, supports all CSS properties, and can be hosted anywhere, including with us.
TypeScript accessibilityalternativecloudflarecloudflare-workersdesignfreefrontendopen-sourceradix-uireactremixweb-developmentwebflowwebsite-builderwebsite-developmentwebsiteswebstudio
Align scrollbars with new design (#1427)
Oleg Isonen4c22d4960f2a
diff --git a/packages/design-system/src/components/scroll-area.tsx b/packages/design-system/src/components/scroll-area.tsxindex 67e5aa8f41..66b00772bb 100644--- a/packages/design-system/src/components/scroll-area.tsx+++ b/packages/design-system/src/components/scroll-area.tsx@@ -1,8 +1,6 @@-import { styled } from "../stitches.config";+import { styled, theme } from "../stitches.config";import { Root, Viewport, Scrollbar, Thumb } from "@radix-ui/react-scroll-area";-const SCROLLBAR_SIZE = 15;-const ScrollAreaRoot = styled(Root, {boxSizing: "border-box",overflow: "hidden",@@ -17,9 +15,8 @@ const ScrollAreaViewport = styled(Viewport, {const ScrollAreaThumb = styled(Thumb, {boxSizing: "border-box",- flex: 1,- background: "rgba(0, 0, 0, 0.5)",- borderRadius: 10,+ background: theme.colors.foregroundMoreSubtle,+ borderRadius: theme.spacing[4],// increase target size for touch devices https://www.w3.org/WAI/WCAG21/Understanding/target-size.htmlposition: "relative","&::before": {@@ -37,26 +34,18 @@ const ScrollAreaThumb = styled(Thumb, {const ScrollAreaScrollbar = styled(Scrollbar, {boxSizing: "border-box",- display: "flex",// ensures no selectionuserSelect: "none",// disable browser handling of all panning and scaleUp gestures on touch devicestouchAction: "none",- paddingRight: 2,- paddingLeft: 6,- background: "rgba(248, 248, 248, 0.76)",- transition: "all 160ms ease-out",- "&:hover": {- paddingRight: 2,- paddingLeft: 2,- borderLeft: `1px solid #e8e8e8`,- },+ paddingRight: theme.spacing[2],+ paddingLeft: theme.spacing[2],'&[data-orientation="vertical"]': {- width: SCROLLBAR_SIZE,+ width: theme.spacing[6],},'&[data-orientation="horizontal"]': {flexDirection: "column",- height: SCROLLBAR_SIZE,+ height: theme.spacing[6],},});@@ -64,7 +53,7 @@ type ScrollAreaProps = { children: JSX.Element | Array<JSX.Element> };export const ScrollArea = ({ children }: ScrollAreaProps) => {return (- <ScrollAreaRoot>+ <ScrollAreaRoot scrollHideDelay={0}><ScrollAreaViewport>{children}</ScrollAreaViewport><ScrollAreaScrollbar orientation="vertical"><ScrollAreaThumb />