<fieldset>
  <input id="pretty" type="checkbox">
  <label for="pretty">Pretty balancing</label>
</fieldset>

<p>Consectetur adipisicing elit. Minus labore ea accusamus consequatur est soluta laboriosam nesciunt, cupiditate illum.</p>
@import "https://unpkg.com/open-props" layer(base);
@import "https://unpkg.com/open-props/normalize.min.css"  layer(base);

@layer demo {
  p {
    text-wrap: unset;
    max-inline-size: 40ch;
    font-size: var(--font-size-4);
  }
  
  body:has(input:checked) p {
    text-wrap: pretty;
  }
}

@layer demo.support {
  * {
    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;
    gap: 5vmin;
  }
  
  fieldset {
    display: flex;
    align-items: center;
    border: none;
    gap: var(--size-2);
    padding: 0;
  }
}
Run Pen

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.