Bugfix: remove Paragraph hardcoded style#1560
Conversation
- remove hardcoded sx props (such style is easy to opt-in with the theme / variants, but harder to opt-out)
|
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/systemui/theme-ui/87h1MaW4hYxQYqA7WVHMgDrQcsia |
|
Let's absolutely axe the max width, but I think we should keep the margin: 0 we've currently got. Otherwise, as the source comment indicates, you can use a Theme UI component & end up with non-theme spacing from the user agent styles. |
|
Yeah, also uncertain about the margin... In the issue, part of the feedback from @aaronadamsCA is:
But theme-ui does not have a "base theme", that's its goal actually (not to have one, allowing anyone to provide such base style for their UI) |
Only if you change the variant to one you added, innit? Good to merge from my perspective if I'm not mistaken here. |
|
I'm okay to go along with removing the margin, but I don't think it's worth breaking people's designs with this change, especially because I would see it as a bug in Theme UI that components have default margins that are not coming from my theme |
Not necessarily I think, if you do not inherit a preset setting |
|
Alright, then let's re-add the margin reset, which can easily be opted out by setting whichever margin value on the |
- to preserve cross-browser style consistency
|
And it's merged! Thanks a lot @flo-sch! |
|
I have been having trouble overriding the margin style. Can we change: <Box
ref={ref}
as="p"
variant="paragraph"
{...props}
sx={{
// reset margin by default: avoid relying on user-agent margins (not aware of theme-ui space scale)
margin: 0,
...sx
}}
...To: <Box
ref={ref}
as="p"
variant="paragraph"
sx={{
// reset margin by default: avoid relying on user-agent margins (not aware of theme-ui space scale)
margin: 0,
...sx
}}
{...props}
...So that you can use margin props (m, my, mx, etc) to override margin? |
|
Seems fine to me @vanbujm! PR welcome |
Fixes #1476
Ping @atanasster since you commented on the original PR, just for awareness and potential feedback?