0

I have below code in my sass application

<div class="btnGroup">
  <div class="kumar"></div>
  <div  class="pavan">
     YourName
     <div class="atlanta" href="#">Primary Action</div>
  </div>
</div>

I have to apply style to <div class="kumar"></div> . only if there is a div with class name "Atlanta" as the child in its adjacent(sibling) div as in the above code otherwise i dont want to apply the style. How to do this in .scss file. Please let me know

Note: i have gone through all the solutions for CSS selectors as mentioned below, i didnt got any solution for my problem. Is there a CSS parent selector?

Is there a "previous sibling" selector?

Temani Afif
  • 180,975
  • 14
  • 166
  • 216
kumar
  • 626
  • 2
  • 10
  • 34
  • 1
    there is no previous nor parent selector as you found out, you need here javascript to test this . sass only compiles its files into plain CSS and never sees the document where css is applied – G-Cyrillus Feb 08 '20 at 20:31
  • Please don't repeat questions just because you don't like the answers you were given – Paulie_D Feb 08 '20 at 20:54
  • @paulie.. u had closed the previous question and you had mnentioned "Your post has been associated with similar questions. If these questions don’t resolve your question, ask a new one.".. – kumar Feb 08 '20 at 21:05
  • so i deleted the old question and created new one as suggested by you.. – kumar Feb 08 '20 at 21:05
  • please also go through the question fully.. My question is not about parent or sibling salector..it is about conditionally applying CSS.. – kumar Feb 08 '20 at 21:09

0 Answers0