JSFiddle - React, Tailwind, and code Playground

by Julien Etienne

HTML

<style>
  .outer-container {
    /* Default styles for the outer container */
    background-color: #ccc;
  }

  .inner-button:focus + .outer-container {
    /* Styles to apply to the outer container when the inner button is focused */
    background-color: #f00; /* Change background color to red when inner button is focused */
  }
</style>

<div class="outer-container">
  <!-- Inner button inside the outer container -->
  <button class="inner-button">Click me</button>
</div>