Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: use styled-system v5 #422

Merged
merged 1 commit into from
Feb 5, 2020
Merged

Conversation

jigsawye
Copy link
Collaborator

@jigsawye jigsawye commented Feb 4, 2020

related #416

之前的 breaking 好像消失了,穩穩升

@jigsawye jigsawye force-pushed the refactor/styled-system-v5 branch 2 times, most recently from 6b5b33a to 928d7a8 Compare February 4, 2020 09:30
@jigsawye jigsawye requested a review from kpman February 4, 2020 09:51
toRem(768),
toRem(992),
toRem(1200),
];
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/styled-system/styled-system/blob/master/packages/core/src/index.js#L62

因為 v5 新增了 cache breakpoints 的功能,但他們實作上只支援 array
所以這邊把 sm / md / lg / xl 的 alias 拿掉了

Copy link
Collaborator

@tw0517tw tw0517tw Feb 5, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

這樣對tailor ui 來說是 breaking change QQ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

但事實上我們沒有用這個功能 XD

<Radio value="en_US">English</Radio>
<Radio value="zh_Hant">正體中文</Radio>
</RadioGroup>

<Box mt="3">
<UIProvider locale={locales[value]}>
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

改成使用全域的 UIProvider 避免多個 Provider 打架

const [visible, setVisible] = useState(false);
const modal = useModal();

return (
<>
<RadioGroup value={value} onChange={setValue}>
<RadioGroup value={locale} onChange={newLocale => setLocale(newLocale)}>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

這個不能直接傳 setLocale 嗎? onChange={setLocale}

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已改

xl: string;
}
string
];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

寫了 4 個 string 耶

@jigsawye jigsawye force-pushed the refactor/styled-system-v5 branch from 928d7a8 to eabe01d Compare February 5, 2020 05:51
JustifyContentProps;

const flex = compose(box, alignItems, flexDirection, justifyContent, flexWrap);
export type FlexProps = BoxProps;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

這邊看不懂,其他的拿掉了?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

v5 把一些相關的 API 整合在一起,詳見:https://styled-system.com/table

@jigsawye jigsawye merged commit f2c06d8 into master Feb 5, 2020
@jigsawye jigsawye deleted the refactor/styled-system-v5 branch February 5, 2020 06:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants