I'm currently exploring ways to modify the style of a parent class based on the presence of a specific child element. It seems that achieving this with CSS3 alone may not be feasible, but it could potentially be done using jQuery.
The parent class in question is .home .x-navbar
And the child class I am looking to target is .x-btn-navbar
Below is the CSS code I intend to apply to the parent class:
background: linear-gradient(to bottom, rgba(0, 0, 0, 0.8) 0%,rgba(0, 0, 0, 0.8) 50%,rgba(0, 0, 0, 0.8) 100%) !important;
background: -webkit-linear-gradient(to bottom, rgba(0, 0, 0, 0.8) 0%,rgba(0, 0, 0, 0.37) 50%,rgba(0, 0, 0, 0) 100%) !important;
background: linear-gradient(to bottom, rgba(0, 0, 0, 0.8) 0%,rgba(0, 0, 0, 0.8) 50%,rgba(0, 0, 0, 0.8) 100%) !important;
Could someone provide me with the necessary jQuery code to achieve the desired effect of modifying the CSS of parent classes when they contain a specific child?