JSFiddle - React, Tailwind, and code Playground

by goodfriend

HTML

<button class="buttonClass">
  <span class="spanClass">
    black/white text
  </span>
  grey/red text
</button>

CSS

.buttonClass{
  color:black;
}
.buttonClass:active{
  color:white;
}
.spanClass{
  color:grey;
}
.spanClass:active{ //working only when I click on span, but not for whole button
  color:red;
}

.buttonClass:active .spanClass{
  color:red;
}