Adds a class name to navigation elements that match the page URL.
To load this plugin, add the following to the extras
block in your
config.php or
theme settings.php:
'extras' => [
// ...
'active-nav' => [
'navSelector' => 'nav li',
'navActiveClass' => 'active',
],
// ...
],
navSelector
- The selector to use to find navigation elements to check.navActiveClass
- The class name to add to the navigation element when active.N/A
N/A
nav li {
color: #001447;
}
nav li.active {
color: #0000e8;
}