django / djangoproject.com

Source code to djangoproject.com
https://www.djangoproject.com/
BSD 3-Clause "New" or "Revised" License
1.86k stars 937 forks source link

Improve mobile markup on a docs page #1488

Open circus2271 opened 4 months ago

circus2271 commented 4 months ago

second tap on mobile version-switcher doesn't necessarily close the menu

https://github.com/django/djangoproject.com/assets/6430448/6b19d7a6-1e34-4d86-8af6-0442f4f751e4

this happens because of hover (tap on button toggles "open" class, but there are also very similar styles which append on hover so, if button already doesn't have "open" class, it may still be open due to hover styles)

the fix is to remove hover for mobile and turn it on only for desktops (width >= 1200px)