Skip to content

Commit 1d55bfa

Browse files
authored
feat: add the hb.docs.navs_active_style parameter (#836)
Available options: empty string or `bordered`. Closes #835
1 parent ff97b23 commit 1d55bfa

File tree

3 files changed

+26
-0
lines changed

3 files changed

+26
-0
lines changed

assets/hb/modules/docs/scss/_nav.scss

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,37 @@
2020
margin-top: 0.25rem;
2121
padding: 0.25rem 0.5rem;
2222
text-decoration: none;
23+
}
2324

25+
.hb-docs-nav-heading {
2426
&:hover,
2527
&.active {
2628
background: var(--#{$prefix}primary-bg-subtle);
2729
}
2830
}
2931

32+
.hb-docs-nav-link {
33+
position: relative;
34+
35+
&:hover,
36+
&.active {
37+
@if ($hb-docs-navs-active-style == '') {
38+
background: var(--#{$prefix}primary-bg-subtle);
39+
}
40+
41+
@if ($hb-docs-navs-active-style == 'bordered') {
42+
&::before {
43+
content: "";
44+
position: absolute;
45+
left: 0;
46+
margin-left: -.325rem;
47+
border-left: 2px solid var(--#{$prefix}primary);
48+
height: 1.25rem;
49+
}
50+
}
51+
}
52+
}
53+
3054
.hb-docs-nav-links {
3155
> .hb-docs-nav-links-span-all {
3256
.hb-docs-nav-link {
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
$hb-docs-navs-sticky-scroll: {{ default true site.Params.hb.docs.navs_sticky_scroll }};
2+
$hb-docs-navs-active-style: '{{ default "" site.Params.hb.docs.navs_active_style }}';

hugo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ cache_key = "page.Type"
1616
date_format = ":date_long"
1717
navs_reduce_font_size = false
1818
navs_sticky_scroll = true
19+
navs_active_style = "" # empty or bordered.
1920

2021
# Takes the full width by default.
2122
[params.hb.full_width_types.docs]

0 commit comments

Comments
 (0)