Problem/Motivation
The dropdown component does not show the desired arrow on open state, because the css is()-Function is not usable for pseudo elements (see https://developer.mozilla.org/en-US/docs/Web/CSS/:is#is_does_not_select_pseudo-elements).
Steps to reproduce
1) Use Olivero as default theme.
2) Go to a page which have a dropdown component.
3) Open a dropdown with more than one child.
4) The arrow shows to bottom on closed stated and on open state it should still the same arrow.
Currently

Updated

Proposed resolution
Move the @nest rule outside of the ::before pseudo element in Line 69 of the dropdown.pcss.css:
&::before {
display: block;
width: var(--sp0-5);
height: var(--sp0-5);
content: "";
transform: translateY(-25%) rotate(45deg);
border-right: solid 2px var(--dropbutton--outline-color);
border-bottom: solid 2px var(--dropbutton--outline-color);
}
@nest .dropbutton-wrapper.open & {
transform: translateY(25%) rotate(225deg);
}
instead of:
&::before {
display: block;
width: var(--sp0-5);
height: var(--sp0-5);
content: "";
transform: translateY(-25%) rotate(45deg);
border-right: solid 2px var(--dropbutton--outline-color);
border-bottom: solid 2px var(--dropbutton--outline-color);
@nest .dropbutton-wrapper.open & {
transform: translateY(25%) rotate(225deg);
}
}
| Comment | File | Size | Author |
|---|---|---|---|
| #22 | without_MR.png | 69.52 KB | arunsahijpal |
| #20 | Dropdown After fix.png | 55.99 KB | kanchan bhogade |
| #16 | 3518192-nr-bot.txt | 91 bytes | needs-review-queue-bot |
| #14 | after.png | 98.14 KB | snehal-chibde |
| #14 | before.png | 98.16 KB | snehal-chibde |
Issue fork drupal-3518192
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #6
jatingupta40 commentedHello @joville
Can you please share few more details like a screenshot of the issue or anything else because i am not able to reproduce this issue on my end.
Thanks.
Comment #7
joville commentedThere you see the screenshots about this issue.
Comment #8
sandip commentedHi @joville, Reproduced this issue in my local successfully. To reproduce this issue i make olivero as Admin theme and go to the
/admin/structure/blockpage. Also changes in the MR not seems to effect any regression. Moving this to Needs Review so maintainers can share their feedback on it.Comment #9
kanchan bhogade commentedHi
I have tested MR 11790 on Drupal version 11.x
The MR is applied successfully, but in issue summary MR is Open Failed Pipeline.
The Dropdown arrow functions as expected after applied MR.
, but in issue summary MR is Open Failed Pipeline.
Moving to Needs work
Comment #10
kanchan bhogade commentedComment #11
sandip commentedHi @kanchan bhogade, i think the failure of pipeline is not related to the file changes in the MR. Can you please check it once.
Comment #12
ressaIt does look unrelated, @sandip you can always try to run that specific failing test again, to make it go green?
Also, adding the GIF's in the Issue Summary, to show visually what this issue is about.
Comment #13
sandip commentedAfter running the failed tests the pipeline is green now.
Comment #14
snehal-chibde commentedHello, I have tested the MR on Drupal version 11.2.x, in Olivero Theme and it is working as expected.
Added before and after screenshots for reference.
Comment #15
sandip commentedI think we can move this issue to RTBC as the MR provided by @joville fix the issue correctly as i mention in #8
Comment #16
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".
This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.
Comment #17
jatingupta40 commentedThe patch applied cleanly and it the dropdown is working fine.
Moving it again to In Review.
Comment #19
igorgoncalves commentedThanks @jatingupta40
the MR was showing a red line at csslint:
"description":"Unexpected deprecated at-rule \"@nest\" (at-rule-no-deprecated)"I committed a fix and Lint looks all green now.
I also applied the last changed patch, and the bug is fixed.
Comment #20
kanchan bhogade commentedHi
I have tested MR 11790 on Drupal 11.x
With MR Dropdown shows desired arrow on open state
Attaching SS for reference
Comment #22
arunsahijpal commentedI think the issue is fixed now pls check.
As I am unable to reproduce it.
Comment #23
sandip commentedHi @arunsahijpal, it is supposed to test the issue in Olivero theme. By looking at your attached image it seems you are testing it in Claro theme.
I tested the MR in local and as the conflicts is resolved and the before and after images are identical to the one that I already attached in comment #8, so I’m not reattaching any images to avoid unnecessary polute.
So moving this issue to RTBC.
Comment #27
nod_Committed 2732a4f and pushed to 11.2.x. Thanks!
We need a MR for 10.6.x and below. Cherry pick isn't clean
Comment #28
sandip commentedI am working on creating the MR for 10.6.x
Comment #30
sandip commentedHi @nod_, I have created the MR. As @nest is removed from all stylesheets in latest 11 version but it is still in use in 10 versions. So i thought not to use @nest here as it is removed in 11 versions.
Please share your thought if it is correct or do i need to add @nest here for 10.6.x
Comment #31
igorgoncalves commentedThanks @sandip
I just check your MR for 10.6.x, and works as expected and fixes the issue.
RTBC +1
Comment #32
jatingupta40 commentedThanks @sandip!
Yes, good call — maintaining compatibility across versions is a good call.
The MR targeting 10.6.x looks good and clean.
RTBC+1
Comment #33
smustgrave commentedSeems like a good backport.
Comment #34
nod_Sorry late to the follow-up. Since we have different rules between 10.x and 11.x I'd rather avoid the inconsistency and not backport this.
Thanks for the dedicated MR though!