Skip to content

Commit

Permalink
style: add the result type icons
Browse files Browse the repository at this point in the history
  • Loading branch information
razonyang committed Sep 16, 2023
1 parent c6879cf commit e9b8c4b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
4 changes: 4 additions & 0 deletions assets/hb/modules/theme-start/scss/_result-types.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
.hb-start-search-result-types {
--#{$prefix}nav-pills-link-active-bg: var(--#{$prefix}secondary);
}

.hb-start-search-result-types {
font-size: 0.875rem;
}
8 changes: 8 additions & 0 deletions layouts/partials/hb/modules/theme-start/functions/icons.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{{- $icons := dict
"images" (partial "icons/icon" (dict "vendor" "bs" "name" "images"))
"maps" (partial "icons/icon" (dict "vendor" "bs" "name" "geo-alt"))
"news" (partial "icons/icon" (dict "vendor" "bs" "name" "newspaper"))
"organic" (partial "icons/icon" (dict "vendor" "bs" "name" "search"))
"videos" (partial "icons/icon" (dict "vendor" "bs" "name" "camera"))
}}
{{- return $icons }}
4 changes: 4 additions & 0 deletions layouts/partials/hb/modules/theme-start/result-types.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{{- $first := true }}
{{- $icons := partialCached "hb/modules/theme-start/functions/icons" . }}
{{- range . }}
<ul
class="hb-start-search-result-types nav nav-pills mb-2{{ cond $first `` ` d-none` }}"
Expand All @@ -20,6 +21,9 @@
{{ with .extra_hidden_input_value }}
data-extra-hidden-input-value="{{ . }}"
{{ end }}>
{{- with index $icons .id }}
<span class="d-none d-md-inline-block">{{ . | safeHTML }}</span>
{{- end }}
{{ .id | printf "search_result_type_%s" | i18n }}
</a>
</li>
Expand Down

0 comments on commit e9b8c4b

Please sign in to comment.