mirror of
https://github.com/BBaoVanC/bobatheme.git
synced 2025-08-31 00:57:33 -05:00
Use hierarchical naming on top and its elements
Any element that can't stand on its own as a self-contained component should have its naming nested under whatever parent it's supposed to have. Fixes #109
This commit is contained in:
@@ -340,7 +340,7 @@ body {
|
||||
* or it will need its hover background to be chopped off on the left */
|
||||
}
|
||||
|
||||
.brand {
|
||||
.top-brand {
|
||||
flex-grow: 1;
|
||||
margin: 8px var(--page-margin);
|
||||
font-size: 1.25em;
|
||||
@@ -348,27 +348,27 @@ body {
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.brand a {
|
||||
.top-brand > a {
|
||||
color: inherit;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.navbar {
|
||||
.top-navbar {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.navbar-item {
|
||||
.top-navbar-item {
|
||||
padding: 12px var(--page-margin);
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.navbar-item:hover {
|
||||
.top-navbar-item:hover {
|
||||
background-color: var(--background-2);
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.navbar-item.active {
|
||||
.top-navbar-item--active {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
|
@@ -1,13 +1,13 @@
|
||||
<header class="top">
|
||||
<div class="brand">
|
||||
<div class="top-brand">
|
||||
<a href="{{ .Site.Home.Permalink | absLangURL }}">
|
||||
{{ .Site.Title | markdownify }}
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<nav class="navbar" aria-label="{{ i18n "aria_navbar" }}">
|
||||
<nav class="top-navbar" aria-label="{{ i18n "aria_navbar" }}">
|
||||
{{ with .Site.Home }}
|
||||
<a class="navbar-item{{ if $.IsHome }} active{{ end }}" href="{{ .Permalink | absLangURL }}">{{ .Title | markdownify }}</a>
|
||||
<a class="top-navbar-item{{ if $.IsHome }} top-navbar-item--active{{ end }}" href="{{ .Permalink | absLangURL }}">{{ .Title | markdownify }}</a>
|
||||
{{ end }}
|
||||
|
||||
{{ range .Site.Menus.main }}
|
||||
@@ -16,7 +16,7 @@
|
||||
{{ if or ($.HasMenuCurrent .Menu .) (eq .Page $) }}
|
||||
{{ $isActive = true }}
|
||||
{{ end }}
|
||||
<a class="navbar-item{{ if $isActive }} active{{ end }}"
|
||||
<a class="top-navbar-item{{ if $isActive }} top-navbar-item--active{{ end }}"
|
||||
{{ if strings.HasPrefix .URL "http" }}target="_blank" rel="noopener"{{ end }}
|
||||
href="{{ .URL }}">{{ .Name }}</a>
|
||||
{{ end }}
|
||||
|
Reference in New Issue
Block a user