CSS Transition Not Applying Properly on Hover with Pseudo Elements in Angular App
I'm confused about I'm collaborating on a project where I'm working through a tutorial and I'm having trouble getting a smooth transition effect on a button that uses a pseudo element for a hover effect in my Angular app... The button should change color and display an underline effect smoothly on hover. Here is how I've set it up: ```css .button { position: relative; padding: 10px 20px; color: #fff; background-color: #007bff; border: none; cursor: pointer; transition: background-color 0.3s ease; } .button::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background-color: #fff; transform: scaleX(0); transition: transform 0.3s ease; } .button:hover { background-color: #0056b3; } .button:hover::after { transform: scaleX(1); } ``` When I hover over the button, the background color changes as expected, but the underline effect is not appearing smoothly; it just pops in instead of scaling. I've tried adjusting the transition duration and easing functions but nothing seems to work. I am using Angular version 12.2.0 and the transitions seem to work fine in other parts of my app. I've also checked that there are no conflicting styles affecting the button. I've run the app in both Chrome and Firefox, and the behavior is consistent across both browsers. Any tips on how to get the transition to apply correctly? Is there a better way to achieve this effect? For context: I'm using Css on macOS. I'm coming from a different tech stack and learning Css. Could this be a known issue? For context: I'm using Css on Linux. What would be the recommended way to handle this?