Browse documentation

Reference / Variants & accessibility

Starting styles

Give a newly displayed element an initial style from which the browser can start a transition.

Working example

Check the box to insert the annotation into layout. In browsers supporting @starting-style it fades in from the specified opacity.

HTML
<div>
  <input id="start-proof" type="checkbox" class="peer accent-black">
  <label for="start-proof">Open the annotation</label>
  <p class="mt-2 hidden border p-2 peer-checked:block motion-safe:transition-opacity motion-safe:duration-500 motion-safe:starting:opacity-0">Trim to the registration marks.</p>
</div>

Class reference

ClassCSS declarations
starting:opacity-0opacity: 0;
starting:translate-y-2--mono-translate-y: 0.5rem; transform: translate3d(var(--mono-translate-x, 0), var(--mono-translate-y, 0), var(--mono-translate-z, 0)) rotate(var(--mono-rotate, 0deg)) skew(var(--mono-skew-x, 0deg), var(--mono-skew-y, 0deg)) scale3d(var(--mono-scale-x, 1), var(--mono-scale-y, 1), var(--mono-scale-z, 1));
starting:scale-95--mono-scale-x: 0.95; --mono-scale-y: 0.95; transform: translate3d(var(--mono-translate-x, 0), var(--mono-translate-y, 0), var(--mono-translate-z, 0)) rotate(var(--mono-rotate, 0deg)) skew(var(--mono-skew-x, 0deg), var(--mono-skew-y, 0deg)) scale3d(var(--mono-scale-x, 1), var(--mono-scale-y, 1), var(--mono-scale-z, 1));
View full generated CSS
Compiled CSS
@property --mono-scale-x {
  syntax: "*";
  inherits: false;
}
@property --mono-scale-y {
  syntax: "*";
  inherits: false;
}
@property --mono-translate-y {
  syntax: "*";
  inherits: false;
}
@starting-style {
  .starting\:opacity-0 {
    opacity: 0;
  }
  .starting\:scale-95 {
    --mono-scale-x: 0.95;
    --mono-scale-y: 0.95;
    transform: translate3d(var(--mono-translate-x, 0), var(--mono-translate-y, 0), var(--mono-translate-z, 0)) rotate(var(--mono-rotate, 0deg)) skew(var(--mono-skew-x, 0deg), var(--mono-skew-y, 0deg)) scale3d(var(--mono-scale-x, 1), var(--mono-scale-y, 1), var(--mono-scale-z, 1));
  }
  .starting\:translate-y-2 {
    --mono-translate-y: 0.5rem;
    transform: translate3d(var(--mono-translate-x, 0), var(--mono-translate-y, 0), var(--mono-translate-z, 0)) rotate(var(--mono-rotate, 0deg)) skew(var(--mono-skew-x, 0deg), var(--mono-skew-y, 0deg)) scale3d(var(--mono-scale-x, 1), var(--mono-scale-y, 1), var(--mono-scale-z, 1));
  }
}