Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
The issue #2349591: Dropdown action list shows up as a simple list without JavaScript introduced a visual regression in the dropbutton:
Before regression:
After regression:
Proposed resolution
Fix the regression
Remaining tasks
- Write a patch
- Review
User interface changes
The collapsible dropbutton links can be clicked over the entire width of the button.
API changes
None
Comment | File | Size | Author |
---|---|---|---|
#3 | 2430999-3.patch | 472 bytes | idebr |
#3 | 2430999-3-after-nojs.png | 124.75 KB | idebr |
#1 | 2430999-1.patch | 420 bytes | idebr |
#1 | 2430999-1.gif | 47.97 KB | idebr |
dropbutton-regression.gif | 70.06 KB | idebr |
Comments
Comment #1
idebr CreditAttribution: idebr commentedAttached patch fixes the visual regression. Screencap after:
Comment #2
LewisNymanThanks for the patch. I thought we had a no-js class but we don't...
Instead of undoing the CSS for JS, maybe we can only set the CSS on :not(.js)?
Comment #3
idebr CreditAttribution: idebr commented@LewisNyman Attached patch uses your suggestion, but I'm hesitant to use this pattern:
- It introduces styling specific for non-javascript users instead of using javascript for progressive enhancement
- It would be the first occurrence of this type of selector in HEAD
Personally I would prefer the approach in #1, but I'll leave the call up to you.
Screenshot with javascript disabled:
Comment #4
LewisNymanThe .no-js class is commonly used on the web, right? The :not(selector) is just a modern equivalent of this. I'd rather not override CSS and the SMACSS principles we've embraced in our coding standards are designed to avoid this kind of CSS. Setting to RTBC and we can at least get a committer's opinion on it.
Comment #5
webchickFrom the look of it, dropbutton.component.css has approximately 50 gazillion
.js .something-something
rules and zero ":not" rules. Therefore, I think #1 is probably best, though it might be worth a separate issue to discuss whether / how to introduce ":not" syntax.Committed and pushed #1 to 8.0.x. Thanks!