Let #box transition discrete properties such as display.
Acceptance criteria
- 1.Let #box transition discrete properties such as display.
CSS Tutorial · CSS Animations & Transitions
These 10 tasks go with the Entry & Exit Transitions chapter. 5 of them ask you to build something small from scratch; 5 give you code that is already broken and ask you to work out why. Set aside about 90 minutes for the whole set, though you can do them in any order.
Nothing here is marked by a person. When you press Submit, the editor checks your code against the points listed under each task and tells you straight away what passed and what didn't (you need a free account to submit). If you get stuck, there are hints, and a worked solution once you've had a go. The first 2 tasks are free; the rest are part of the practice plan.
If it's been a while since you read the chapter, here is how it starts: “Animate elements as they enter, leave, or move through the top layer with starting styles and discrete property transitions. It covers first-render transitions, discrete properties, popovers, dialogs, top-layer removal, and reduced-motion handling.” .
1.Allow discrete transitionsexercise · easy · 10 min
Let #box transition discrete properties such as display.
Passes when: Let #box transition discrete properties such as display.
2.Transition displayexercise · easy · 10 min · practice plan
Make display the transitioned property on #box.
Passes when: Make display the transitioned property on #box.
3.Transition two propertiesexercise · easy · 10 min · practice plan
Transition opacity and display, in that order.
Passes when: Transition opacity and display, in that order.
4.Give each its own durationexercise · easy · 10 min · practice plan
0.3s for the first property and 0.5s for the second.
Passes when: 0.3s for the first property and 0.5s for the second.
5.Build a full exit transitionexercise · medium · 10 min · practice plan
Fade out and remove from layout, allowing discrete steps.
Passes when: Fade out and remove from layout, allowing discrete steps.
6.Fix the missing discrete behaviourbug fix · easy · 8 min
display will not transition without allow-discrete.
Passes when: display will not transition without allow-discrete.
7.Fix the misspelled valuebug fix · easy · 8 min · practice plan
The value is allow-discrete.
Passes when: The value is allow-discrete.
8.Fix the property orderbug fix · easy · 8 min · practice plan
Opacity should be listed before display.
Passes when: Opacity should be listed before display.
9.Fix the space-separated listbug fix · easy · 8 min · practice plan
Multiple transitioned properties are comma separated.
Passes when: Multiple transitioned properties are comma separated.
10.Fix the single durationbug fix · easy · 8 min · practice plan
Each property needs its own duration here.
Passes when: Each property needs its own duration here.
Between them these tasks cover transition-behavior, Transitioning display and Discrete properties.
Looking for a different chapter? See every practice set, or switch to the interview theory questions.