-
-
Notifications
You must be signed in to change notification settings - Fork 199
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 theme toggle in navbar. #499
base: main
Are you sure you want to change the base?
Conversation
- Add additional logic for navbar partial. - Uses a menu item params.type of `theme-toggle`. - Uses additional params.hideLabel boolean to set hideLabel for the theme-toggle.html partial.
✅ Deploy Preview for hugo-hextra ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
This isn't a perfect PR, as I didn't include any updates to documentation for this feature and instead focused on implementation. I figured if this looks good, I could add documentation changes to this PR. :) |
- Add navbar boolean to theme-toggle partial arguments. - Add logic in theme-toggle to set icon size based on navbar boolean.
Gave theme-toggle partial logic based on navbar boolean, to set size of icon based on navbar or elsewhere. This does not address the size of the toggle's label. I see the |
Put logic in theme-toggle when in navbar to match size of navbar text. |
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.
will take a second look by manually testing it.
{{- $height_px := 12 -}} | ||
{{- $height_tw := "hx-text-xs" -}} | ||
{{- if $navbar -}} | ||
{{- $height_px = 24 -}} | ||
{{- $height_tw = "hx-text-sm" -}} | ||
{{- 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.
just curious where are 12
and 24
coming from?
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.
Great question! I've been offline for a few weeks, and honestly, I'd have to say it is likely a best estimate based on testing that made things look "right."
If those values can be computed from other inputs in the theme configuration, I'm certainly willing to explore that. Do you have any guidance on how we might calculate a sane value for this?
theme-toggle
.Addresses #343 .