<span class="tag">Oh yeah</span>
@layer demo {
  .tag {
    /* if we put .5 extra leading on this */
    line-height: 1.5;
    
    /* we can divvy equal spacing to the inline edges */
    /* offsetting the extra height */
    /* making even spacing all around */
    padding-inline: calc(.5lh / 2);
  }
}

@layer demo.support {
  .tag {
    border-radius: 5px;
    background: magenta;
    color: white;
  }
  
  * {
    box-sizing: border-box;
    margin: 0;
  }

  html {
    block-size: 100%;
    color-scheme: dark light;
  }

  body {
    min-block-size: 100%;
    font-family: system-ui, sans-serif;

    display: grid;
    place-content: center;
  }
}
Run Pen

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.