-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
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
refactor(theme): split admonitions, make swizzle easier, better retrocompatibility #7945
Conversation
✅ [V2]
To edit notification comments on pull requests, go to your Netlify site settings. |
⚡️ Lighthouse report for the deploy preview of this PR
|
Size Change: +48 B (0%) Total Size: 813 kB
ℹ️ View Unchanged
|
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.
Maybe add some docs about this? (Wasn't satisfied with our admonition customization docs)
Yes, it's not finished yet. I'm also trying to see what can be shared, so that it's easier later to add a Tailwind theme without too much duplication. I guess we'll also want to share things such as the default labels and icons which are not really theme-specific, but we still want the ability to swizzle to override? 🤷♂️ |
packages/docusaurus-theme-classic/src/theme/Admonition/Types.tsx
Outdated
Show resolved
Hide resolved
Ready for review. Satisfied with the current implementation: will merge soon unless I get feedback |
I'll try reviewing this tonight. |
Looks good enough: marked as safe to swizzle. Note: as we have more "mapping objects" in themes, we should probably add a way to declare a theme module is an object. This way we could support swizzle --wrap such objects. Showing "wrap is forbidden" to the user is a bit confusing considering we encourage wrapping (manually) in our doc We'll probably do some more admonition options breaking changes in the future but probably not before v4.0. It looks good enough for me to commit to respecting semver |
Motivation
:::important
should display label "important" (as it used to be), fix "Important" admonition has "info" as label #7767Test Plan
preview
Test links
Deploy preview:
Local: