Quantcast
Channel: phpBB.com
Viewing all articles
Browse latest Browse all 2339

[3.3.x] Styles Support & Discussion • Re: Help needed with dropdown animation

$
0
0
I don't doubt that the above code works, but I cannot see the point of .dropdown-toggle + .dropdown

The way the default markup is done, all instances of .dropdown are also .dropdown-toggle + .dropdown. In terms of targeting the only difference is that the latter has higher specificity. That's useful in some situations but does not appear to be useful here. The declarations later in the cascade will overrule the earlier ones even without greater specificity. IOW, the code can be simplified.

This works just as well:

Code:

.dropdown {opacity: 1;transform: scaleY(1);transform-origin: top;transition-property: opacity, transform, overlay, display;transition-duration: 0.4s;transition-behavior: allow-discrete;}.dropdown-up .dropdown {transform-origin: bottom;}@starting-style {.dropdown {opacity: 0;transform: scaleY(0);}}
The use of @starting-style is a good trick though. I hadn't seen that one before.

Statistics: Posted by Gumboots — Tue Apr 29, 2025 11:15 pm



Viewing all articles
Browse latest Browse all 2339

Trending Articles