Looking for help with CSS:
/* targeting laptops */
@media only screen and (pointer:fine) and (max-device-height: 620px) {
#root:has(.projects) ~ body {
overflow: auto; /* allow scrolling */
}
}
My desired outcome is to set overflow: auto
on the page if we are on a laptop (pointer: fine)
with a window height of 620px
or less, and if there is a .projects
element under #root
(meaning we are on the projects page).
I am aware that the issue lies here:
#root:has(.projects) ~ body
What could be causing this not to work, and how can I achieve my intended result?