Skip to main content
InterviewHubPRO
Section Overview
Q27

Question 27 of 50

Part 3: Advanced Internals, Scale & Production Architecture (Senior / Lead)

54%
CSS3 & Modern Layouts (50 Qs)•Part 3: Advanced Internals, Scale & Production Architecture (Senior / Lead)

The `@starting-style` Rule for Animating Elements from `display: none`.

senior LevelCode ExampleSystem Design

In Simple Words: Historically, transitioning an element entering the DOM from display: none was impossible without JavaScript timeouts because display is not a continuous property. @starting-style defines the initial styling before the element's first style update:

css
dialog[open] {
  opacity: 1;
  transform: scale(1);
  transition: opacity 0.3s, transform 0.3s, display 0.3s allow-discrete;

  @starting-style {
    opacity: 0;
    transform: scale(0.9);
  }
}