Skip to content

Commit c6f9909

Browse files
committed
Remove Hyperscript from Tailwind migration
- Menu toggle is handled by custom JS
1 parent 181416e commit c6f9909

File tree

4 files changed

+11
-8
lines changed

4 files changed

+11
-8
lines changed

assets/src/main.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// Toggle the navigation menu on small screens
2+
document.getElementById("navigation-toggle").addEventListener("click", function () {
3+
const navMenu = document.querySelector("#navigation-menu");
4+
navMenu.classList.toggle("hidden");
5+
});

config/settings/base.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@
111111
os.path.join(BASE_DIR, "pythonsd", "static"),
112112
# Only available after running `npm install`
113113
os.path.join(BASE_DIR, "node_modules/htmx.org/dist"),
114-
os.path.join(BASE_DIR, "node_modules/hyperscript.org/dist"),
115114
]
116115

117116
STORAGES = {

package.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
"version": "0.2.0",
44
"description": "San Diego Python Website - sandiegopython.org",
55
"scripts": {
6-
"dist": "tailwindcss -i ./assets/src/input.css -o ./assets/dist/main.css --minify",
7-
"build": "tailwindcss -i ./assets/src/input.css -o ./assets/dist/main.css",
8-
"watch": "tailwindcss -i ./assets/src/input.css -o ./assets/dist/main.css --watch"
6+
"dist": "cp ./assets/src/main.js ./assets/dist/ && tailwindcss -i ./assets/src/input.css -o ./assets/dist/main.css --minify",
7+
"build": "cp ./assets/src/main.js ./assets/dist/ && tailwindcss -i ./assets/src/input.css -o ./assets/dist/main.css",
8+
"watch": "cp ./assets/src/main.js ./assets/dist/ && tailwindcss -i ./assets/src/input.css -o ./assets/dist/main.css --watch"
99
},
1010
"repository": {
1111
"type": "git",
@@ -22,8 +22,7 @@
2222
},
2323
"homepage": "https://github.com/sandiegopython/pythonsd-django#readme",
2424
"dependencies": {
25-
"htmx.org": "^1.9.12",
26-
"hyperscript.org": "^0.9.12"
25+
"htmx.org": "^1.9.12"
2726
},
2827
"devDependencies": {
2928
"tailwindcss": "^3.4.3"

pythonsd/templates/pythonsd/base.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
</a>
3030

3131
<!-- Navigation menu toggle -->
32-
<div id="navigation-toggle" class="h-6 w-6 cursor-pointer md:hidden block text-slate-100" _="on click toggle .hidden on #navigation-menu">
32+
<div id="navigation-toggle" class="h-6 w-6 cursor-pointer md:hidden block text-slate-100">
3333
<svg xmlns="http://www.w3.org/2000/svg" id="menu-button" fill="none" viewBox="0 0 24 24" stroke="currentColor">
3434
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16"></path>
3535
</svg>
@@ -107,7 +107,7 @@
107107
</footer>
108108

109109
<script src="{% static 'htmx.min.js' %}"></script>
110-
<script src="{% static '_hyperscript.min.js' %}"></script>
110+
<script src="{% static 'main.js' %}"></script>
111111

112112
</body>
113113
</html>

0 commit comments

Comments
 (0)