<div class="card">
  <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Inventore consectetur temporibus quae aliquam nobis nam accusantium, minima quam iste magnam autem neque laborum nulla esse cupiditate modi impedit sapiente vero?</p>
</div>
:root {
  --base: 1.35; /* Handy multiplier for consistency across elements */
  --background: lch(0% 0 0 / 1);
}

body {
  background-image: radial-gradient(circle at top, #222, var(--background));
  display: grid;
  height: 100vh;
  place-items: center;
}

.card {
  background-color: var(--background);
  border: 2px solid lch(100% 0 0 / 0.25);
  border-radius: 16px;
  color: lch(100% 0 0 / 0.85);
  font-size: calc(1rem * var(--base));
  line-height: var(--base);
  max-width: 35ch;
  padding: calc(1rem * var(--base));
}

.card p {
  max-height: calc(
    4rem * var(--base)
  ); /* Set a cut-off point for the content */
  overflow: hidden; /* Cut off the content */
  position: relative;
}

.card p:after {
  content: "";
  background: linear-gradient(to right, transparent, var(--background) 80%);
  border: 1px solid red;
  height: calc(1rem * var(--base) + 1px);
  position: absolute;
  inset-block-end: 0;
  width: 100%;
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.