-
-
Notifications
You must be signed in to change notification settings - Fork 8.8k
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
feat(theme-classic): new 'html' type navbar item #7058
Conversation
112f42e
to
d97bb0f
Compare
✅ [V2]
To edit notification comments on pull requests, go to your Netlify site settings. |
⚡️ Lighthouse report for the changes in this PR:
Lighthouse ran on https://deploy-preview-7058--docusaurus-2.netlify.app/ |
Size Change: +774 B (0%) Total Size: 799 kB
ℹ️ View Unchanged
|
✅ [V2]
To edit notification comments on pull requests, go to your Netlify site settings. |
d97bb0f
to
9ce578e
Compare
3a77edc
to
a11b386
Compare
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.
I think we should simply introduce a new type: "html"
element, like { type: "html", value: "<b>Supported package managers</b>" }
, so that it's more in line with the sidebar item. It would be more inconsistent with footer items, but footer items don't have multiple types and aren't polymorphic anyways.
In addition, I don't think pure HTML top-level navbar items are useless, and could potentially make things more consistent (since we only forbid nested dropdowns, and HTML elements aren't dropdowns). WDYT?
I agree, this might useful if need to add a button or a link with an SVG icon as navbar item. But I don't know, is it necessary to keep the original class |
The HTML sidebar items also add |
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.
packages/docusaurus-theme-classic/src/theme/NavbarItem/HtmlNavbarItem.tsx
Outdated
Show resolved
Hide resolved
…barItem.tsx Co-authored-by: Sébastien Lorber <slorber@users.noreply.github.com>
Any suggestions for improvement it? I agree, it doesn't look perfect, but it's perfectly acceptable. |
I agree. And in light mode the font color/size is a bit inconsistent. Would be better if we can have some special styles on mobile. |
@lex111 Do you want to do some little improvements for the mobile sidebar so the styling looks more consistent, or do you think this is good enough to merge? |
No, I think the current styling is good enough. |
I see what you mean, all good then! |
Motivation
Inside a dropdown, it is sometimes useful to separate some items from others, or to group many items by adding heading text. Something like this:
So I propose to allow using raw html as content inside a dropdown item list.
Have you read the Contributing Guidelines on pull requests?
Yes
Test Plan
See preview.
Related PRs