1

I have a block on my Drupal 9 site which only appears if the web browser is compatible with PWA technology.

When PWA is not compatible, the block is hidden, but not the title.

How can I hide the block title with display: none; when the browser is not PWA compatible ?

Browser compatible with PWA technology :

enter image description here

Browser not compatible with PWA technology :

enter image description here

mplungjan
  • 169,008
  • 28
  • 173
  • 236
  • Please visit [help], take [tour] to see what and [ask]. Do some research, search for related topics on SO; if you get stuck, post a [mcve] of your attempt, noting input and expected output, preferably in a [Stacksnippet](https://blog.stackoverflow.com/2014/09/introducing-runnable-javascript-css-and-html-code-snippets/) – mplungjan Jul 31 '21 at 19:50
  • My question is how to hide the entire block if the PWA is not compatible. I want to do this with CSS. As you can see, there is a difference in class in the 2 cases. –  Jul 31 '21 at 20:13
  • Does this answer your question? [Is there a CSS parent selector?](https://stackoverflow.com/questions/1014861/is-there-a-css-parent-selector) – skyline3000 Jul 31 '21 at 20:22
  • What is the process that hides that element ? does it relay on a class like pwa-a2hs set already on that block ? if yes, add id to the title too or only on the parent. It might not be a CSS job here since the job seems to be done elsewhere ahead for that container. – G-Cyrillus Jul 31 '21 at 21:07
  • maybe this? https://stackoverflow.com/a/76567457/1243247 – João Pimentel Ferreira Jun 27 '23 at 17:51

0 Answers0