Skip to content

Commit 946b10c

Browse files
committed
feat: Add navbar list with borders style
Add the navbar list with borders to site header navbar. Also fixes the theme toggle button not centered by centering all elements in navbar list items using display flex and align center.
1 parent 1998fba commit 946b10c

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

assets/styles/_header.scss

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,20 @@
7070

7171
> li {
7272
flex: 0 0 auto;
73-
padding: $spacer-smallest $spacer-small;
74-
border: $spacer-2 dotted;
75-
margin-right: -#{$spacer-2};
73+
padding-left: $spacer-small;
74+
display: flex;
75+
justify-content: center;
76+
}
77+
78+
&.borders {
79+
> li {
80+
padding: $spacer-smallest $spacer-small;
81+
border: $spacer-2 dotted;
82+
margin-right: $spacer-2 * -1;
7683

77-
@include themed {
78-
border-color: t($accent);
84+
@include themed {
85+
border-color: t($accent);
86+
}
7987
}
8088
}
8189
}

layouts/partials/navbar.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
{{- /* navbar */}}
55
<nav class="navbar">
66
<div class="navbar__first">
7-
<ul class="navbar__list">
7+
<ul class="navbar__list borders">
88
<li><a href="{{ $logoLink }}">{{ $logoText }}</a></li>
99
<li>
1010
<button class="theme-toggle transparent">
@@ -19,7 +19,7 @@
1919

2020
{{- if site.Params.showMenuItems }}
2121
<div class="navbar__last">
22-
<ul class="navbar__list menu--desktop">
22+
<ul class="navbar__list borders menu--desktop">
2323
{{- range site.Menus.main -}}
2424
{{- if not .HasChildren }}
2525
<li><a href="{{ .URL }}">{{ .Name }}</a></li>

0 commit comments

Comments
 (0)