-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
[RNMobile] Introduce a common API to style Button from both web and mobile #19179
[RNMobile] Introduce a common API to style Button from both web and mobile #19179
Conversation
…e/experimental/button/styled-system/emotion
@@ -27,8 +28,9 @@ const BlockBreadcrumb = ( { | |||
} ) => { | |||
return ( | |||
<View style={ styles.breadcrumbContainer }> | |||
<TouchableOpacity | |||
style={ styles.button } | |||
<PrimitiveButton |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These changes are only for demonstrating how to style component usingstyled-system
props
@@ -38,6 +38,8 @@ function ButtonBlockAppender( { | |||
rootClientId={ rootClientId } | |||
renderToggle={ ( { onToggle, disabled, isOpen } ) => ( | |||
<Button | |||
isLarge |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For demonstrating that isPrimary
and isLarge
works
Just to confirm, this PR doesn't include real implementations of these props. But just demonstrates a way about how to use such props to customize style. |
This PR is quite old, and it has unclear status. Do you plan to work on it further or can it be closed? |
Description
This is an exploration of x-platform style system. wordpress-mobile/gutenberg-mobile#1411
This is the second iteration on wordpress-mobile/gutenberg-mobile#1386
Gutenberg-mobile PR - wordpress-mobile/gutenberg-mobile#1684
In this PR I used
styled-system
withemotion
to create a primitive Button component that could be used in web and mobile and could be styled via props. That PR contains the mobile part.button
primitive component (TouchableOpacity
) that can be used withstyled-system
Box
component to replacediv
#17614 )@components/Button
isSmall
,isLarge
andisPrimary
props and set button style related to them (just to demonstrate)isLarge
andisPrimary
to@components/Button
inButtonBlockAppender
component to demonstrate they work :)How has this been tested?
gutenberg-mobile
appblue
background and additional padding (because ofisLarge
andisPrimary
)Screenshots
without
isLarge
andisPrimary
with
isLarge
andisPrimary
Types of changes
Experimenting with
emotion
andstyled-system