Skip to content

Commit 624e27a

Browse files
author
Elliot
authored
Fieldset: Accordion mode auto-indentation (#1156)
* Added auto-indent to Fieldset accordion mode * Added changelog * Updated snapshot
1 parent 1a3d3fe commit 624e27a

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [UNRELEASED]
99

10+
### Changed
11+
12+
- `Fieldset` accordion mode auto-indents elements in the inner `AccordionContent`
13+
1014
### Fixed
1115

1216
- `DialogContent` with `borderBottom` prop CSS output error (no border, no flex: 8)

packages/components/src/Form/Fieldset/Fieldset.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,13 @@ export const Fieldset = styled(FieldsetLayout)`
182182
${simpleLayoutCSS}
183183
184184
${AccordionContent} {
185+
padding-left: ${({ theme }) => {
186+
const borderWidth = '1px'
187+
const defaultIndicatorSize = theme.space.medium
188+
const defaultIndicatorGap = theme.space.xsmall
189+
190+
return `calc(${borderWidth} + ${defaultIndicatorSize} + ${defaultIndicatorGap})`
191+
}};
185192
padding-top: ${({ theme }) => theme.space.medium};
186193
}
187194

packages/components/src/Form/Fieldset/__snapshots__/Fieldset.test.tsx.snap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ exports[`Fieldset 1`] = `
129129
}
130130
131131
.c0 .c12 {
132+
padding-left: calc(1px + 1rem + 0.5rem);
132133
padding-top: 1rem;
133134
}
134135

0 commit comments

Comments
 (0)