-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
Admonitions: hide header (icon and title) #8568
Comments
Related to: #8458 For feature requests we require a detailed API design, including the syntax used. You miss those by selecting the wrong template. |
ok, thanks! |
I do think it's fair as feature request though, just we need more design for it to be actionable. |
Definitively something I'd like to add. In the meantime you can probably do something like
And swizzle the component to not render the icon/heading if title === "NO_ICON" |
I think keeping the icon makes sense, otherwise, the only differentiation is the background color. |
I'm not here to judge if having an icon makes sense. Users should be able to decide for themselves if they want one. We should rather use the Markdown directive syntax, since we already use remark-directive anyway. :::note{icon=false}
content
::: Whatever is in A little annoying thing is that directives do not seem to be typed, here we get Our remark admonition plugin is also not in an ideal form so I'll refactor all this some day when I have time. |
Regarding this specific issue, I can reproduce when using admonitions through JSX nodes. import Admonition from '@theme/Admonition';
<Admonition type="info" title={null} icon={null}>
<p>Some information</p>
</Admonition> https://stackblitz.com/edit/github-jit8sw?file=docs%2Fintro.md This is probably just a little conditional rendering issue in our <AdmonitionContainer type={type} className={className}>
- <AdmonitionHeading title={title} icon={icon} />
+ {(title || icon) ? <AdmonitionHeading title={title} icon={icon} /> : null}
<AdmonitionContent>{children}</AdmonitionContent>
</AdmonitionContainer> If someone wants to submit a PR for this, it should be relatively easy. Please add a test case in this page so that we can see it working in the deploy preview: https://docusaurus.io/tests/pages/markdown-tests-mdx#admonitions |
@slorber I'll deal with this |
Have you read the Contributing Guidelines on issues?
Hide header (icon and title)
Motivation
I can pass empty icon and title, but header height not changes. I'd like to full hide header
Like this:
The text was updated successfully, but these errors were encountered: