Skip to content

ebay-accordion: Accordion list styles unexpectedly apply to list items that are children of the accordion #2619

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
1 task done
caseycarroll opened this issue Apr 3, 2025 · 0 comments

Comments

@caseycarroll
Copy link

I verified there's no existing issue for this bug.

  • There are no existing issues

Current behavior

When a list item is a descendant of an accordion, it receives the accordion divider border style intended to exist between accordion summary elements.

Expected behavior

The visual divider for accordions should not be applied to lists rendered inside of an accordion.

Skin version

19

Device/OS/Browser info

Macbook Pro, MacOS Sonoma, Chromium, Safari, Firefox

Steps to reproduce

Using the ebay core UI accordion component like so:


<ebay-accordion>
   <@details>
       <@summary>List of cool stuff</@summary>
       <ul>
            <li>Cats</li>
            <li>Coffee</li>
      </ul>
   </@details>
</ebay-accordion>


The list items "Cats" and "Coffee" will having the following CSS rule applied:

ul.accordion li:not(:last-child) {
    border-bottom: 1px solid var(--color-stroke-subtle);
}

Relevant code block

ul.accordion li:not(:last-child) {
    border-bottom: 1px solid var(--color-stroke-subtle);
}

This could be resolved by only targeting direct descendants.

ul.accordion > li:not(:last-child) {
    border-bottom: 1px solid var(--color-stroke-subtle);
}

Additional context

Image
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Todo
Development

No branches or pull requests

2 participants