dequelabs / dequelabs/cauldron

AccordionContent: vertical padding causes too much spacing if children have top/bottom margin defined

Open Beginner friendly
#2,482 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
TypeScript
Stars
127
Forks
31
Avg merge
2d 12h
Merged PRs (30d)
8

Description

### Steps to reproduce

```tsx

example

some content

more content

```

In practice, this more or less means every consumer needs to do a margin reset on whatever content is inside the panel today to get the desired spacing. What should instead happen is that we should add `:first-child`/`:last-child` based resets to the panel similar to what we already do in `panel.css:72-81`:

```css
.Panel__Content > :first-child {
margin-top: 0;
}

.Panel__Content > :last-child {
margin-bottom: 0;
}
```

### Expected Behavior

The text in AccordionContent should be as far away from the top/bottom boundaries of the content panel as the defined AccordionContent padding.

### Actual Behavior

It instead uses the *sum* of AccordionPanel's padding PLUS whatever margin is set on the `

` elements

### Version

7.2.0

### What browser(s) are you experiencing the problem on?

Chrome

Contributor guide

Open the contributing guide

Research direction

Start by locating the AccordionContent styles and compare them with the existing first- and last-child margin resets in panel.css:72-81. Reproduce the example with paragraph margins, then verify that the first and last children are spaced from the panel boundaries by only the defined AccordionContent padding.

Written by the indexing model from the issue text.

Assessment

Tech stack
css, react, typescript
Domain
frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
78/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.