From 6da54c9e128136cd798e36c75a680827d3987c08 Mon Sep 17 00:00:00 2001 From: zakingslayerv22 <11926638+zakingslayerv22@users.noreply.github.com> Date: Tue, 10 Jun 2025 10:56:23 -0400 Subject: [PATCH] Update transitions.md Before reading Josh Comeau's blog https://www.joshwcomeau.com/animation/css-transitions/ as attached in the assignments. I spent a lot of time trying to figure out how the brower automatically knows that it should trigger the transition on hover. I think informing the readers that transition works with CSS property values that change, can be more helpful and better prepare them for Josh Comeau's blog post. --- advanced_html_css/animation/transitions.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/advanced_html_css/animation/transitions.md b/advanced_html_css/animation/transitions.md index 7c303fe37ca..f31c4bfa5f4 100644 --- a/advanced_html_css/animation/transitions.md +++ b/advanced_html_css/animation/transitions.md @@ -57,7 +57,11 @@ button:hover { } ``` -The above transition will occur when the user hovers their mouse over the button as indicated by the `:hover` pseudo-class. In addition to `:hover`, or any of the other pseudo-classes, you can also trigger transitions by adding or removing classes with JavaScript. For example, clicking a button could append the "open" class to a dropdown menu, which would trigger the opening transition. +With the code above, you're instructing the browser as follows: + +*Whenever `background-color` changes, animate it over `1 second` using `ease-out` timing, but wait `0.25 seconds` before starting the animation.* + +When the user hovers their mouse over the button (as indicated by the `:hover` pseudo-class), the computed `background-color` changes from white to black. This change triggers the transition, causing the background color to animate smoothly based on the declared rules. In addition to `:hover`, or any of the other pseudo-classes, you can also trigger transitions by adding or removing classes with JavaScript. For example, clicking a button could append the "open" class to a dropdown menu, which would trigger the opening transition. ### Performance