-
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
added a Text component #18495
added a Text component #18495
Conversation
@jameslnewell Thank you so much for adding this! 🎉 I left a couple of comments for you. I am incredibly excited for this particular component. Something that renders text may seem trivial.. but there are many benefits as we start using this throughout the system. The folks within the native mobile world have already enjoyed the benefits of this. In the future, I could see us enhancing this primitive with features like |
@jameskoster I've updated the styles to match the code-pen. Can you please confirm they're current. 🙏 |
@ItsJonQ since the mobile variant is a Colors is something I definitely want to add in a followup PR! 👇
|
@jameslnewell Oh yes, I was talking about adding that feature for the web version of |
I have some questions here. How are we planning to use this component? |
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.
In the period with lots of time off, I completely forgot about this PR.
I think, this one is in good shape and it's an important bit leading towards validation of the CSS in JS approach. Let's get it in and see how it all works.
Co-Authored-By: Grzegorz (Greg) Ziółkowski <[email protected]>
Co-Authored-By: Grzegorz (Greg) Ziółkowski <[email protected]>
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.
@jameslnewell Looks great! Thank you for working on this!
Description
Added a
Text
mixin and component to@wordpress/components
which provides typography styles in-line with thewp-admin-iterations
experiment.This addition provides a
text
mixin (e.g.text({ variant: 'body.small' })
) that can be consumed in other components which are also usingemotion
(probably focussed more on internal usage) in addition to aText
component (e.g.<Text variant="body.small">
).This component is usable on web AND mobile, including styles.
To keep this PR small and easily reviewable I haven't included the following additions that I'll attempt to add in a future PR:
Text
component e.g.color
,textAlign
,margin
,padding
etc etctext
mixin into other components in order to improve the consistency of typography across the componentsRelated PR: #18244
How has this been tested?
I've written a few tests for web and react-native and manually tested the web component in
storybook
. I'm not sure what the best approach is to manually test in react native before the package is published??Screenshots
See the storybook.
Types of changes
New feature - mixins and a component for reusing/composing typography consistently
Checklist:
as
prop