-
Notifications
You must be signed in to change notification settings - Fork 167
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: Support Hero Icons in the nav bar menu #359
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,6 +56,12 @@ | |
{{ if $external }}target="_blank" rel="noreferer"{{ end }} | ||
class="hx-text-sm contrast-more:hx-text-gray-700 contrast-more:dark:hx-text-gray-100 hx-relative -hx-ml-2 hx-hidden hx-whitespace-nowrap hx-p-2 md:hx-inline-block {{ $activeClass }}" | ||
> | ||
{{ with .Params.hero_icon -}} | ||
<span style="float: left; padding-right: 0.3em; padding-top: 2px; opacity: 0.75"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we use Tailwind CSS classes here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I bet we could. I was hoping you'd know what they are. :-) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can begin converting them. |
||
{{ partial "utils/icon.html" (dict "name" . "attributes" "height=18") }} | ||
</span> | ||
{{- end }} | ||
|
||
<span class="hx-text-center">{{ or (T .Identifier) .Name | safeHTML }}</span> | ||
</a> | ||
{{- end -}} | ||
|
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'd prefer
icon
overhero_icon
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.
Ah, but
.icon
sets it as icon only, I believe. That's why I went withhero_icon
.A nice enhancement for clarity might be to change
icon
toicon_item
and deprecateicon
.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.
Or, we could refactor this even more. Personally, I do like "making illegal states impossible". Although this gets a little bulky.
The docs describe this as four page types. Three of them are implicitly defined. We could use
type
for these as well (it's already used fortype: search
). That could look like this: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 like the idea of using an extra
type
there, let's consider these casesIn the future, we may extend the
type
to other widgets, for example, light/dark/system theme toggle switch: