Skip to content

Commit

Permalink
fix sx usages by replacing sx with __css and by omitting it in prop t…
Browse files Browse the repository at this point in the history
…ypes
  • Loading branch information
anilanar committed May 12, 2024
1 parent f4610be commit 192e40f
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .changeset/lemon-sheep-brush.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@moblin/chakra-ui": patch
---

fix sx prop not working
2 changes: 1 addition & 1 deletion packages/chakra-ui/src/Box.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const Box = forwardRef<BoxProps, "div">(
direction="column"
justifyContent={valign}
alignItems={halign}
sx={{
__css={{
overflowAnchor,
}}
>
Expand Down
6 changes: 3 additions & 3 deletions packages/chakra-ui/src/Flex.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export const FlexItem = ({
justifyContent={alignSelf ?? unsafeCoerce("var(--pcss-flex-align-items)")}
minW={shrink > 0 ? "var(--pcss-flex-child-shrink-width)" : "auto"}
minH={shrink > 0 ? "var(--pcss-flex-child-shrink-height)" : "auto"}
sx={{
__css={{
"& > *": {
flexGrow:
alignSelf === "stretch"
Expand Down Expand Up @@ -107,12 +107,12 @@ export const Flex = forwardRef<FlexProps, "div">(
flexDirection="row"
alignItems="stretch"
ref={ref}
sx={{
__css={{
overflowAnchor,
}}
>
<chakra.div
sx={{
__css={{
"--pcss-flex-align-items": alignItems,
"--pcss-flex-child-direction": isHorizontal(direction)
? "column"
Expand Down
2 changes: 1 addition & 1 deletion packages/chakra-ui/src/Scrollable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export const Scrollable = forwardRef<ScrollableProps, "div">(
overflowY={isVertical(direction) ? unsafeCoerce(scrollMode) : "hidden"}
flexDirection={direction}
alignItems="stretch"
sx={{
__css={{
overflowAnchor,
"& > *": {
flex: justifyContent === "stretch" ? "1 0 auto" : "0 0 auto",
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
keyof StyleProps | "__css"
> &
BackgroundProps &
BorderProps &
Expand Down

0 comments on commit 192e40f

Please sign in to comment.