File tree Expand file tree Collapse file tree 3 files changed +29
-2
lines changed Expand file tree Collapse file tree 3 files changed +29
-2
lines changed Original file line number Diff line number Diff line change
1
+ {% from 'components/menu_icon.html' import menu_icon %}
2
+
1
3
{% macro navbar() %}
2
- < nav class ="container navbar ">
4
+ < nav class ="container navbar "
5
+ data-controller ="navbar ">
3
6
< div class ="navbar-left-group ">
4
7
< a href ="/ " class ="navbar-item ">
5
8
dry-python
6
9
</ a >
7
10
</ div >
8
- < div class ="navbar-right-group ">
11
+ < div class ="block lg:hidden ">
12
+ < button class ="navbar-button "
13
+ data-action ="navbar#toggle ">
14
+ {{ menu_icon('Menu') }}
15
+ </ button >
16
+ </ div >
17
+ < div class ="navbar-right-group "
18
+ data-target ="navbar.menuItems ">
9
19
{% for path, label in bag('navbar').items() %}
10
20
< a href ="{{ path|url }} " class ="navbar-item ">
11
21
{{ label }}
Original file line number Diff line number Diff line change
1
+ import { Controller } from 'stimulus'
2
+
3
+ export default class extends Controller {
4
+ static targets = [ 'menuItems' ]
5
+
6
+ toggle ( ) {
7
+ this . menuItemsTarget . classList . toggle ( 'hidden' )
8
+ }
9
+ }
Original file line number Diff line number Diff line change 17
17
.navbar-item : hover {
18
18
@apply .text-black .border-black ;
19
19
}
20
+
21
+ .navbar-button {
22
+ @apply flex items-center px-3 py-2 border rounded text-teal-lighter border-teal-light;
23
+ }
24
+
25
+ .navbar-button : hover {
26
+ @apply text-white border-white;
27
+ }
You can’t perform that action at this time.
0 commit comments