|
sx={{ |
|
// reset margin by default: avoid relying on user-agent margins (not aware of theme-ui space scale) |
|
margin: 0, |
|
// set a max-width: avoid full-page paragraphs |
|
'@media screen and (min-width: 36em)': { |
|
maxWidth: '48rem', |
|
}, |
|
...sx, |
|
}} |
While 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.
theme-ui/packages/components/src/Paragraph.js
Lines 14 to 22 in 29b9b37
While I appreciate the intent, this makes it really tough to use
Paragraphexcept for one very specific use case. It takes a specificity hack to defeat it using the theme:I think the
marginreset probably belongs in a base theme, and themaxWidthis an interesting idea that could be mentioned in the documentation or included in a paragraph variant in one of the themes.