-
Notifications
You must be signed in to change notification settings - Fork 276
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
Remove typography styles from not-prose
elements in addition to their children
#301
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
For others on the team when thinking through this — we’ll want to think through the impact of this as a breaking change, since adding this class to an element like |
Perhaps we could make this configurable? |
I have a working prototype for that. The plugin options would look something like that… module.exports = plugin.withOptions(
({ className = 'prose', target = 'modern', includeNotProsedElement = false } = {}) => {
return function ({ addVariant, addComponents, theme, prefix }) {
let modifiers = theme('typography')
let options = { className, prefix, includeNotProsedElement }
… But how you would name such a setting? Naming is hard 😉 |
not-prose
elements in addition to their children
Hey thanks for this contribution @jonnitto! |
Hey folks. This turned out a breaking change for my sites and a widely used Starter Kit I run for Statamic as I used the Maybe I could use that config option, but tbh I'm not really sure how to implement that. Is there someone willing to explain this a bit? Thanks a bunch in advance! 🙌 |
Never mind, figured out a different way of doing this going forward. |
Heya, this change turned out to be pretty breaking for Protocol template Repro: Download protocol, install deps, should be broken with 5.10 |
Is there recommended fix for |
@Strajk @b5 hey yeah there is. We spent a little bit of time figuring out a simple update to the template to work around these changes in the typography plugin. We've updated our live preview as well as the download link for the template to address these issues caused by the change. A summary of what we've done is:
The diffs look like this:
- // Layout
- '> *': {
- maxWidth: theme('maxWidth.2xl'),
- marginLeft: 'auto',
- marginRight: 'auto',
- '@screen lg': {
- maxWidth: theme('maxWidth.3xl'),
- marginLeft: `calc(50% - min(50%, ${theme('maxWidth.lg')}))`,
- marginRight: `calc(50% - min(50%, ${theme('maxWidth.lg')}))`,
- },
- },
<Component
- className={clsx(className, 'prose dark:prose-invert')}
+ className={clsx(
+ className,
+ 'prose dark:prose-invert',
+ // `html :where(& > *)` is used to select all direct children without an increase in specificity like you'd get from just `& > *`
+ '[html_:where(&>*)]:mx-auto [html_:where(&>*)]:max-w-2xl [html_:where(&>*)]:lg:mx-[calc(50%-min(50%,theme(maxWidth.lg)))] [html_:where(&>*)]:lg:max-w-3xl',
+ )}
{...props}
/>
let containerClassName =
- 'not-prose my-6 overflow-hidden rounded-2xl bg-zinc-900 shadow-md dark:ring-1 dark:ring-white/10'
+ 'my-6 overflow-hidden rounded-2xl bg-zinc-900 shadow-md dark:ring-1 dark:ring-white/10'
<Tab.Group {...tabGroupProps} className={containerClassName}>
- {header}
- {panels}
+ <div className="not-prose">
+ {header}
+ {panels}
+ </div>
</Tab.Group> <div className={containerClassName}>
- {header}
- {panels}
+ <div className="not-prose">
+ {header}
+ {panels}
+ </div>
</div> Hope that helps and let us know if you notice anything else! ✨ |
This was a breaking change for our docs site as well. I can appreciate that this option makes sense for many people, but it really doesn't make sense to add potentially breaking behavior changes into a patch update, given that the project follows Semantic Versioning. |
Close #299