Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
feat: Update Text and Heading Themes for New DS #10606
feat: Update Text and Heading Themes for New DS #10606
Changes from 10 commits
9511d07
1585ecc
22b8d0c
de25c36
97ce437
adf11e6
3ccf261
22e3cd4
db48b20
136fd28
e0173dc
36e303b
7b7e05c
b1f02f0
c3a38a5
7d7eeba
4b35120
74e5dc8
cf974b8
a500d33
7f26b77
20d98a2
f2d3572
6e56568
7fbab53
af14c1b
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
@TylerAPfledderer we discussed with Nuno about these sizes and we've updated them to match the same sizes than Chakra https://chakra-ui.com/docs/styled-system/theme#typography
Now,
md
should be the samemd
as in Chakra (1 rem). Same with the rest.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.
@pettinarip to clarify, this is just regarding the
Text
component? It looks like the sizes for theHeading
component have not changed (which is to be expected since they are currently inline with the Chakra defaults)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.
Also need clarification regarding the body copy with this update. Marked a question in the figma file as I found a discrepancy.
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.
Correct @TylerAPfledderer. The
Heading
has not suffered any update.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.
@pettinarip this is now updated in the PR
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.
Now, looking at the preview deploy, I see that we kind of depend on this margin to avoid having to refactor all the codebase. I'd say that for the
Text
component we add this button margin. What do you think @nloureiro and @TylerAPfledderer?Note for context for @nloureiro. This
Text
component represents thep
tag, the paragraphs in html.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.
@pettinarip fair point!
So for example, with the Homepage hero where this margin would be used against the CTA button "Explore Ethereum", when working on the new heroes I took a different approach, whereby I structured the Header and text under one flex stack, and then that grouping with the button at a higher level stack, and used the
gap
orspacing
prop to define the "margin" between the different texts and between the paragraph and the button.I should ask then what would best practice be here? In my description above, this approach using the Flexbox
gap
property to define the margins between content instead of using themargin
prop.And I would consider in addition to the above the idea of using
margin
only when we are stacking paragraphs, with a defined :first- or :last-of-type selector so that only margin is defined between the paragraphs, but not added above the first or below the last of the stacked siblings.So:
However, I also understand that margin has to be well defined for the mdx file parsing because you have no ability to isolate groups of text elements into neatly packaged boxes. So I would want to figure out what the best practice should be to keep usage in MDX pages inline with the page layouts that do not use MDX.
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.
Using
gap
andspacing
is correct and expected as the best way to go looking ahead.Now, talking about the current problem and thinking about how to support the old margins, I think that the best way to go is by leaving the
Text
component as it is and creating a new temporary one calledOldText
that would have the old margins.Following this idea
Text
component would be used in all new implementationOldText
would be marked as deprecated and would be used in the rest of the old/current implementations.The
OldText
component might be something as simple as thisWith that new component in place, I could go and refactor the entire codebase by importing the
OldText
and adding those changes to this PR.Then, as you migrate the new components as the
Hero
, you can start using and importing the nativeText
.Does it make sense?
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.
@pettinarip Ok! So using the
OldText
component for the MDX files too, correct?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.
Correct.
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.
@pettinarip I've pushed this new component here.
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.
Thanks. I'll refactor the code to use that component instead of the
Text
.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.
Sounds good!
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.
@TylerAPfledderer @pettinarip maybe this is normal, but having 3 times
as="h1"
is correct?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.
@nloureiro I could only assume that the three largest sizes would be reserved for the
h1
heading. If that is true, then I would make sure that the story reflected that preference.