-
Notifications
You must be signed in to change notification settings - Fork 750
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(text): Add styled system { layout } style to Text #96
feat(text): Add styled system { layout } style to Text #96
Conversation
I'm not sure it's worth to add a prop for this. And if we really want, use this https://styled-system.com/api#layout |
@@ -1,33 +1,33 @@ | |||
import styled from "styled-components"; | |||
import Text from "../Text/Text"; | |||
import { tags, sizes, HeadingProps } from "./types"; | |||
import { tags, scales, HeadingProps } from "./types"; |
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.
- As
size
is a reserved styled-systemlayout
prop, I've renamed this prop in<Heading>
to 'scale' - this matches the sizing props pattern used throughout the codebase (Button, Checkbox, Input, Toggle, Progress, Radio, Tag, Toggle) - If we are happy with this change, I'll prepare FE & Exchange PRs changing this prop value throughout the codebase.
Yea good point @RabbitDoge. I still think having access to the Can I get a re-up on the review? |
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.
Seems nice, actually need this functionality too, thanks! 👍
Recently, I have needed to restyle the
<Text>
component to have the display property: inline, for example when piecing together a single piece of text with different styles:Or, a
<Balance>
component, preceded by a~
Both of these examples require a styled component to be initialised, with the required
display
style.As per CR feedback - I am passing the styled system
{ layout }
styles to our Text component, allowing us to pass this display style as a prop, rather than needing to declare a styled component.Breaking changes
size
is a reserved styled-systemlayout
prop, I've renamed this for headings to 'scale' - this matches the sizing props pattern used throughout the codebase (Button, Checkbox, Input, Toggle, Progress, Radio, Tag, Toggle)