Skip to content

Commit

Permalink
Make tutorial filter buttons more recognizable (#1790)
Browse files Browse the repository at this point in the history
  • Loading branch information
npentrel authored Sep 11, 2023
1 parent 7be784a commit d9fd2ad
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
15 changes: 10 additions & 5 deletions assets/js/tutorials.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,10 +216,15 @@ search.on('render', function() {

document.body.addEventListener('click', function(event) {
let filter_box = document.getElementById('tutorial-filter-items');
if (!filter_box.contains(event.target)) {
open_elem = filter_box.getElementsByClassName("show");
if (open_elem) {
open_elem[0].classList.remove("show");
}
let tutorial_menu = document.getElementById('tutorial-menu');
if (!filter_box.contains(event.target) && !tutorial_menu.contains(event.target)) {
document.querySelectorAll('.filter').forEach( el => {
el.setAttribute("aria-expanded", false);
el.classList.add("collapsed");
});
let open_elem = filter_box.getElementsByClassName("show");
if (open_elem) {
open_elem[0].classList.remove("show");
}
}
}, true);
9 changes: 9 additions & 0 deletions assets/scss/_styles_project.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1167,6 +1167,15 @@ ul.sectionlist > li:hover {
border: 1px solid black;
}

#tutorial-filters > .filter:hover {
background-color: #e7e5e4;
cursor: pointer;
}

#tutorial-filters > .filter[aria-expanded="true"]{
background-color: #e7e5e4;
}

.ais-Hits-item {
display: flex;
}
Expand Down

0 comments on commit d9fd2ad

Please sign in to comment.