Compare commits

..

17 Commits

Author SHA1 Message Date
Mark Dumay
1452109194 Merge pull request #416 from gethinode/hugo-mod-dependencies
Update Hugo module dependencies
2023-08-14 10:33:29 +02:00
Mark Dumay
512f39ed8a Merge branch 'main' into hugo-mod-dependencies 2023-08-14 10:25:29 +02:00
Mark Dumay
39c6f922fe Merge pull request #417 from gethinode/develop
Fix navbar behavior
2023-08-14 10:23:20 +02:00
Mark Dumay
e8ccd62987 Merge branch 'main' into develop 2023-08-14 09:30:47 +02:00
mark
210237c42f Ensure all elements use the same base id 2023-08-14 09:29:33 +02:00
mark
daa2295cea Bump dependencies 2023-08-14 09:11:14 +02:00
mark
e6d5c16f12 Fix #415 2023-08-14 09:10:48 +02:00
markdumay
e0dea81ef5 fix: update Hugo module dependencies 2023-08-14 03:15:09 +00:00
Mark Dumay
2889f8e8b1 Merge pull request #414 from gethinode/develop
Fix accessibility issues
2023-08-13 13:09:42 +02:00
mark
ac6d3504be Fix stylelint error 2023-08-13 12:52:10 +02:00
mark
fdaf7de75e Improve alert accessibility 2023-08-13 09:08:18 +02:00
Mark Dumay
185b8b5f40 Merge branch 'main' into develop 2023-08-13 08:26:26 +02:00
mark
603590e95b Bump package version 2023-08-13 08:26:04 +02:00
mark
9cf7825384 Fix theme for transparent navbar 2023-08-13 08:23:13 +02:00
mark
d50814ab08 Improve toc accessibility 2023-08-13 08:19:27 +02:00
mark
97d77d0dfc Improve sidebar accessibility 2023-08-13 08:16:48 +02:00
mark
4ec4cf28de Fix background color of primary alert in dark mode 2023-08-13 07:04:32 +02:00
12 changed files with 60 additions and 30 deletions

View File

@@ -40,8 +40,7 @@
})
for (let i = 0; i < activeSelectors.length; ++i) {
activeSelectors[i].className = activeIcon.className
activeSelectors[i].className = activeSelectors[i].className.replace('theme-icon', 'theme-icon-active')
activeSelectors[i].innerHTML = activeIcon.innerHTML
}
for (let i = 0; i < activeButtons.length; ++i) {

View File

@@ -29,7 +29,11 @@
.form-range::-moz-range-thumb {
background-color: var(--bs-primary);
}
.alert-primary {
--bs-alert-bg: var(--bg-primary-subtle);
}
.btn-outline-primary {
--bs-btn-color: var(--bs-primary);
--bs-btn-border-color: var(--bs-primary);

View File

@@ -1,3 +1,18 @@
.alert-no-decoration {
--bs-alert-border-radius: none;
.alert code {
color: inherit;
}
/* stylelint-disable declaration-block-no-redundant-longhand-properties */
.alert a {
color: inherit;
&:link,
&:visited,
&:hover,
&:active {
text-decoration-line: underline;
text-decoration-style: dotted;
text-decoration-color: var(--bs-body);
}
}
/* stylelint-enable declaration-block-no-redundant-longhand-properties */

View File

@@ -69,24 +69,25 @@
@if $enable-dark-mode {
@include color-mode(dark) {
.sidebar-item {
color: var(--bs-tertiary-color);
color: var(--bs-body-color);
margin-left: 0 !important;
padding-left: 0.85rem !important;
&.active,
&:hover,
&:focus {
color: var(--bs-secondary-color);
color: white !important;
background-color: transparent;
}
}
.btn-toggle {
color: var(--bs-tertiary-color);
color: var(--bs-body-color);
&:hover,
&:focus {
color: $secondary;
background-color: tint-color($primary, 90%);
color: white !important;
background-color: transparent;
}
&::before {
@@ -105,8 +106,8 @@
&:hover,
&:focus {
color: $secondary;
background-color: tint-color($primary, 90%);
color: white !important;
background-color: transparent;
}
&.active {

View File

@@ -83,6 +83,10 @@
.toc nav a {
color: var(--bs-body-color);
&:hover {
color: white;
}
}
}
}

View File

@@ -4,7 +4,7 @@ go 1.19
require (
github.com/gethinode/mod-bootstrap v1.1.1 // indirect
github.com/gethinode/mod-flexsearch v1.3.0 // indirect
github.com/gethinode/mod-flexsearch v1.4.0 // indirect
github.com/gethinode/mod-fontawesome v1.2.5 // indirect
github.com/gethinode/mod-katex v1.0.2 // indirect
github.com/gethinode/mod-leaflet v0.3.4 // indirect

View File

@@ -4,6 +4,8 @@ github.com/gethinode/mod-flexsearch v1.2.0 h1:SSMpWzK9SMbi9QRYfil9PJZLLWWLHWzlTc
github.com/gethinode/mod-flexsearch v1.2.0/go.mod h1:TXbGbWsvmhBdsTzRt887mcpFfr4ORpzG3+h/l4W3YM4=
github.com/gethinode/mod-flexsearch v1.3.0 h1:RbfEDw219Y1rOVp9lHmy5ePdF9lyPalDu2J5oVeejrU=
github.com/gethinode/mod-flexsearch v1.3.0/go.mod h1:TXbGbWsvmhBdsTzRt887mcpFfr4ORpzG3+h/l4W3YM4=
github.com/gethinode/mod-flexsearch v1.4.0 h1:5e/NVRLyWzUZ9fO/fNsM5o+O7nw+xyln2rfEOtbgfWc=
github.com/gethinode/mod-flexsearch v1.4.0/go.mod h1:TXbGbWsvmhBdsTzRt887mcpFfr4ORpzG3+h/l4W3YM4=
github.com/gethinode/mod-fontawesome v1.2.4 h1:SqE3CQ+boaBIhrVh3MPu4nz0uoHPfEH5t60nNY1CfsI=
github.com/gethinode/mod-fontawesome v1.2.4/go.mod h1:Ki1qkWEOiF0hQpCgWeZRw+HkpL6nd1DxKFptU0O2feI=
github.com/gethinode/mod-fontawesome v1.2.5 h1:RqkLRj6+s+gM4nKd0IwNMMDA8cRmxfp0fxkVH4FdAGU=

2
go.mod
View File

@@ -4,7 +4,7 @@ go 1.19
require (
github.com/gethinode/mod-bootstrap v1.1.1 // indirect
github.com/gethinode/mod-flexsearch v1.3.0 // indirect
github.com/gethinode/mod-flexsearch v1.4.0 // indirect
github.com/gethinode/mod-fontawesome v1.2.5 // indirect
github.com/gethinode/mod-katex v1.0.2 // indirect
github.com/gethinode/mod-leaflet v0.3.4 // indirect

2
go.sum
View File

@@ -20,6 +20,8 @@ github.com/gethinode/mod-flexsearch v1.2.0 h1:SSMpWzK9SMbi9QRYfil9PJZLLWWLHWzlTc
github.com/gethinode/mod-flexsearch v1.2.0/go.mod h1:TXbGbWsvmhBdsTzRt887mcpFfr4ORpzG3+h/l4W3YM4=
github.com/gethinode/mod-flexsearch v1.3.0 h1:RbfEDw219Y1rOVp9lHmy5ePdF9lyPalDu2J5oVeejrU=
github.com/gethinode/mod-flexsearch v1.3.0/go.mod h1:TXbGbWsvmhBdsTzRt887mcpFfr4ORpzG3+h/l4W3YM4=
github.com/gethinode/mod-flexsearch v1.4.0 h1:5e/NVRLyWzUZ9fO/fNsM5o+O7nw+xyln2rfEOtbgfWc=
github.com/gethinode/mod-flexsearch v1.4.0/go.mod h1:TXbGbWsvmhBdsTzRt887mcpFfr4ORpzG3+h/l4W3YM4=
github.com/gethinode/mod-fontawesome v1.0.2 h1:ZSK6D20/w4y5GnfYfTBB58uHD0ChIfkpKfRGwioS9rg=
github.com/gethinode/mod-fontawesome v1.0.2/go.mod h1:Ki1qkWEOiF0hQpCgWeZRw+HkpL6nd1DxKFptU0O2feI=
github.com/gethinode/mod-fontawesome v1.1.0 h1:rsDzUI+3ZlS/do2ff3ne8/z3KwHeysmuA+WsXlumXXk=

View File

@@ -1,6 +1,7 @@
<!--
Displays a navigation header with a toggler. The partial supports the following arguments:
"id" Optional id of the navbar toggler, defaults to "navbar-collapse-0".
"id" Optional id of the navbar, defaults to "navbar-0". The id is used by several child elements,
including a color mode switcher, version switcher, and collapse panel.
"page" Required object reference to the current page.
"menus" Optional name of the menu configuration, defaults to "main".
"size" Optional size of the button, either "sm", "md" (default), or "lg".
@@ -20,13 +21,14 @@
{{- define "partials/navbar-mode.html" -}}
{{- $size := .size -}}
{{- $collapsed := .collapsed -}}
{{- $id := .id -}}
<li class="nav-item dropdown {{ if $collapsed }}d-{{ $size }}-none{{ else }}d-none d-{{ $size }}-block{{ end }}">
<a class="nav-link dropdown-toggle" href="#!" role="button" data-bs-toggle="dropdown" aria-label="{{ T "colorMode" }}" aria-expanded="false" id="navbar-color-theme{{ if $collapsed }}-collapsed{{ end }}">
<span class="theme-icon-active">{{- partial "assets/icon.html" (dict "icon" "fas sun fa-fw") }} {{ if $collapsed }} {{ T "colorMode" }} {{ end }}</span>
<a class="nav-link dropdown-toggle" href="#!" role="button" data-bs-toggle="dropdown" aria-label="{{ T "colorMode" }}" aria-expanded="false" id="{{ $id }}-theme{{ if $collapsed }}-collapsed{{ end }}">
<span class="theme-icon-active">{{- partial "assets/icon.html" (dict "icon" "fas sun fa-fw") }}</span>{{ if $collapsed }} {{ T "colorMode" }} {{ end }}
<span class="d-md-none"></span>
</a>
<ul class="dropdown-menu dropdown-menu-end" aria-labelledby="navbar-color-theme{{ if $collapsed }}-collapsed{{ end }}">
<ul class="dropdown-menu dropdown-menu-end" aria-labelledby="{{ $id }}-theme{{ if $collapsed }}-collapsed{{ end }}">
<li>
<a class="dropdown-item{{ if $collapsed }} switch-mode-collapsed{{ end }}" data-bs-theme-value="light" href="#!">
<span class="theme-icon">{{- partial "assets/icon.html" (dict "icon" "fas sun fa-fw") }}</span>&nbsp;
@@ -55,13 +57,14 @@
{{- $collapsed := .collapsed -}}
{{- $page := .page -}}
{{- $list := site.Params.docs.releases -}}
{{- $id := .id -}}
{{- $version := partial "utilities/GetVersion.html" (dict "page" $page) -}}
<li class="nav-item dropdown {{ if $collapsed }}d-{{ $size }}-none{{ else }}d-none d-{{ $size }}-block{{ end }}">
<a class="nav-link dropdown-toggle" href="#!" role="button" data-bs-toggle="dropdown" aria-expanded="false" id="navbar-version-switch">
<a class="nav-link dropdown-toggle" href="#!" role="button" data-bs-toggle="dropdown" aria-expanded="false" id="{{ $id }}-version-switch">
{{ if $collapsed }}{{ site.Title }} {{ end }}{{ $version }}
</a>
<ul class="dropdown-menu dropdown-menu-end" aria-labelledby="navbar-version-switch">
<ul class="dropdown-menu dropdown-menu-end" aria-labelledby="{{ $id }}-version-switch">
{{- range $index, $item := $list -}}
{{- $active := eq $item.label $version -}}
{{- $disabled := false -}}
@@ -97,7 +100,7 @@
{{- $absoluteURL := site.Params.main.canonifyAssetsURLs | default false -}}
{{- $supportedFlags := slice "true" "false" -}}
{{- $id := printf "navbar-collapse-%d" 0 -}}
{{- $id := printf "navbar-%d" 0 -}}
{{ with .id }}
{{ $id = . }}
{{ end }}
@@ -185,12 +188,12 @@
{{- $theme := "light" -}}
{{- if in (slice "primary" "secondary" "success" "danger" "black") $color }}{{ $theme = "dark" }}{{ end -}}
{{- if in (slice "body" "body-tertiary") $color }}{{ $theme = "" }}{{ end -}}
{{- if not $color }}{{ $theme = "" }}{{ end -}}
{{- $class := .class -}}
{{- $contrast := false -}}
{{- if in (slice "primary" "secondary" "success" "danger") $color }}{{ $contrast = true }}{{ end -}}
<div class="container-fluid {{ if $fixed }}fixed-top{{ end }} p-0{{ with $class }} {{ . }}{{ end }}">
{{- partial "assets/page-alert.html" (dict "page" $page) -}}
<nav class="navbar navbar-expand-{{ $size }}{{ if $contrast }} navbar-contrast{{ end }}{{ with $color }} bg-{{ . }}{{ end }} p-4"{{ with $theme }} data-bs-theme="{{ . }}"{{ end }}>
@@ -228,7 +231,7 @@
</button>
</div>
<div class="navbar-collapse collapse" id="{{ $id }}">
<div class="navbar-collapse collapse" id="{{ $id }}-collapse">
<!-- Insert search input -->
{{- if $search }}{{ partial "assets/search-input.html" -}}{{ end -}}
@@ -281,8 +284,8 @@
<!-- Insert version switcher -->
{{- if $enableVersions -}}
{{- partial "partials/navbar-versions.html" (dict "page" $page "size" $size "collapsed" true ) -}}
{{- partial "partials/navbar-versions.html" (dict "page" $page "size" $size "collapsed" false) -}}
{{- partial "partials/navbar-versions.html" (dict "page" $page "size" $size "collapsed" true "id" .id) -}}
{{- partial "partials/navbar-versions.html" (dict "page" $page "size" $size "collapsed" false "id" .id) -}}
{{- end -}}
<!-- Insert color mode switcher -->
@@ -293,8 +296,8 @@
</li>
<li><hr class="dropdown-divider-bg"></li>
{{- partial "partials/navbar-mode.html" (dict "size" $size "collapsed" true) -}}
{{- partial "partials/navbar-mode.html" (dict "size" $size "collapsed" false) -}}
{{- partial "partials/navbar-mode.html" (dict "size" $size "collapsed" true "id" .id) -}}
{{- partial "partials/navbar-mode.html" (dict "size" $size "collapsed" false "id" .id) -}}
{{- end -}}
</ul>
</div>

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "@gethinode/hinode",
"version": "0.18.0-beta2",
"version": "0.18.0-beta3",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@gethinode/hinode",
"version": "0.18.0-beta2",
"version": "0.18.0-beta3",
"license": "MIT",
"devDependencies": {
"@fullhuman/postcss-purgecss": "^5.0.0",

View File

@@ -1,6 +1,6 @@
{
"name": "@gethinode/hinode",
"version": "0.18.0-beta2",
"version": "0.18.0-beta3",
"description": "Hinode is a clean documentation and blog theme for Hugo, an open-source static site generator",
"keywords": [
"hugo",