Skip to content

CSS Animation Exercise (03-dropdown-menu): Replace display with visibility for dropdown menu animation #704

@kesava-karri

Description

@kesava-karri

Complete the following REQUIRED checkboxes:

  • I have thoroughly read and understand The Odin Project Contributing Guide
  • The title of this issue follows the location for request: brief description of request format, e.g. Foundations exercises: Add exercise for XYZ

The following checkbox is OPTIONAL:

  • I would like to be assigned this issue to work on it

1. Description of the Feature Request:
The dropdown menu animation exercise currently uses display: none to display: block for showing/hiding the menu, which prevents smooth CSS animations from working properly. The exercise should use visibility: hidden to visibility: visible instead, as this allows the CSS animation to work correctly while still hiding the element from view.

2. Acceptance Criteria:

  • Replace display: none with visibility: hidden in the .dropdown-menu selector
  • Replace display: block with visibility: visible in the .visible selector
  • Update the solution file to reflect the same changes
  • Add a comment explaining why visibility is preferred over display for animations
  • Ensure the animation still works correctly with the new visibility approach

3. Additional Information:
The current implementation has a fundamental issue where display property changes cannot be animated, making the CSS animation ineffective. Using visibility instead allows the scaleY transform animation to work properly while still hiding the element when not visible. This is a common best practice for CSS animations and would improve the learning experience by demonstrating proper animation techniques.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: Needs ReviewThis issue/PR needs an initial or additional review

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions