Remove sx props from Paragraph component
See original GitHub issueWhile I appreciate the intent, this makes it really tough to use Paragraph
except for one very specific use case. It takes a specificity hack to defeat it using the theme:
export const theme = {
text: {
paragraph: {
':not(_)': {
my: 3,
maxWidth: 'unset'
}
}
}
}
I think the margin
reset probably belongs in a base theme, and the maxWidth
is an interesting idea that could be mentioned in the documentation or included in a paragraph variant in one of the themes.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Developers - Remove sx props from Paragraph component -
Remove sx props from Paragraph component. ... I appreciate the intent, this makes it really tough to use Paragraph except for one very...
Read more >The `sx` Prop - Theme UI
The sx prop lets you add any valid CSS to an element, while using values from your theme to keep styles consistent. You...
Read more >MUI: how to style a <p> using sx prop? - Stack Overflow
So how am I supposed to style a paragraph? Is targeting using classes the only option here? reactjs · material-ui.
Read more >Display - MUI System
Quickly and responsively toggle the display value of components and more with the display utilities. Includes support for some of the more common...
Read more >sx prop - Mantine
All Mantine components support sx prop. With sx you can add styles to component root element. If you need to customize styles of...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@flo-sch No idea TBH, mate. I remember jxnblk’s comment he wanted to move towards
sx
everywhere, but I’m not sure if I can find it.My opinion on this is:
className
prop similar tostyle
prop but allowing all legal CSS (Emotion) or even fancier shenanigans (That’s Theme UI).Hi @aaronadamsCA 👋 Thanks for the issue!
cc @lachlanjc @flo-sch