Skip to content

Commit

Permalink
add __css support
Browse files Browse the repository at this point in the history
  • Loading branch information
anilanar committed May 12, 2024
1 parent a910218 commit dee2cb6
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions packages/chakra-ui/src/Box.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export const Box = forwardRef<BoxProps, "div">(
halign = "stretch",
valign = "stretch",
overflowAnchor,
__css,
...props
},
ref
Expand All @@ -32,6 +33,7 @@ export const Box = forwardRef<BoxProps, "div">(
justifyContent={valign}
alignItems={halign}
__css={{
...__css,
overflowAnchor,
}}
>
Expand Down
2 changes: 2 additions & 0 deletions packages/chakra-ui/src/Flex.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ export const Flex = forwardRef<FlexProps, "div">(
alignContent = "flex-start",
wrap = false,
overflowAnchor,
__css,
...props
},
ref
Expand All @@ -108,6 +109,7 @@ export const Flex = forwardRef<FlexProps, "div">(
alignItems="stretch"
ref={ref}
__css={{
...__css,
overflowAnchor,
}}
>
Expand Down
3 changes: 3 additions & 0 deletions packages/chakra-ui/src/Scrollable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export const Scrollable = forwardRef<ScrollableProps, "div">(
direction = "column",
justifyContent = "flex-start",
overflowAnchor,
__css,
...props
},
ref
Expand All @@ -48,7 +49,9 @@ export const Scrollable = forwardRef<ScrollableProps, "div">(
flexDirection={direction}
alignItems="stretch"
__css={{
...__css,
overflowAnchor,
// ignore __css['& > *'] on purpose.
"& > *": {
flex: justifyContent === "stretch" ? "1 0 auto" : "0 0 auto",
[marginStartProp(direction)]: marginStart(justifyContent),
Expand Down
2 changes: 1 addition & 1 deletion packages/chakra-ui/src/props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export type SafeSpaceProps = Pick<

export type ContainerProps<T extends As> = Omit<
HTMLChakraProps<T>,
keyof StyleProps | "__css"
keyof StyleProps
> &
BackgroundProps &
BorderProps &
Expand Down

0 comments on commit dee2cb6

Please sign in to comment.