<section>
  <div><button interestfor="my-popover">Default speed</button>
    <div id="my-popover" popover="hint" role="tooltip">Default speed <div class="arrow-down"></div>
    </div>
  </div>
  <div><button interestfor="my-popover-2">A bit faster</button>
    <div id="my-popover-2" popover="hint" role="tooltip">faster speed (240ms)<div class="arrow-down"></div>
    </div>
  </div>
  <div>
    <button interestfor="my-popover-3">Fast speed</button>
    <div id="my-popover-3" popover="hint" role="tooltip">Fastest (140ms)<div class="arrow-down"></div>
    </div>
  </div>
</section>
@import url("https://fonts.googleapis.com/css2?family=Urbanist:ital,wght@0,100..900;1,100..900&display=swap");

button {
  anchor-name: --button-1;
  position: relative;
  font-family: "Urbanist", sans-serif;
  font-weight: 700;
  font-size: 1.2rem;
  background: var(--background, #db2955);
  padding: 15px 24px;
  border: 0;
  border-radius: 30px;
  color: #fff;
  box-shadow: 0 8px 0 var(--shadow, #a42142);
  transition: box-shadow 0.1s ease-out, translate 0.1s ease-out;
  cursor: pointer;
  &:active {
    box-shadow: 0 4px 0 var(--shadow, #a42142);
    translate: 0 4px;
  }
}

[popover] {
  position: absolute;
  border: 0;
  margin: 0 0 20px 0;
  background: #9da39a;
  color: white;
  position-anchor: --button-1;
  position-area: top;
  padding: 20px;
  border-radius: 30px;
  opacity: 0;
  overflow: visible;
  translate: 0 50%;
  transition: opacity 0.2s ease-out, translate 0.2s ease-out,
    overlay 0.2s ease-out, display 0.2s ease-out;
  transition-behavior: allow-discrete;
  .arrow-down {
    position: absolute;
    bottom: -10px;
    left: 50%;
    margin-left: -5px;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid #9da39a;
  }
  &:popover-open {
    opacity: 1;
    translate: 0 0;
    @starting-style {
      opacity: 0;
      translate: 0 50%;
    }
  }
}

[interestfor="my-popover-2"] {
  --background: #e69d28;
  --shadow: #bf8220;
  color: black;
  interest-delay: 0.24s;

  anchor-name: --button-2;
}

#my-popover-2 {
  position-anchor: --button-2;
}

[interestfor="my-popover-3"] {
  --background: #49d33c;
  --shadow: #35962c;
  color: black;
  interest-delay: 0.14s;

  anchor-name: --button-3;
}

#my-popover-3 {
  position-anchor: --button-3;
}

section {
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  font-family: "Urbanist", sans-serif;
  color: #fff;
  background: #54494b;
}
Run Pen

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.