Skip to content

Commit

Permalink
💄 style: Fix form group style
Browse files Browse the repository at this point in the history
  • Loading branch information
canisminor1990 committed Jan 3, 2025
1 parent 0b0eb7b commit 69ec600
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
11 changes: 9 additions & 2 deletions src/Form/components/FormGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import Icon, { type IconProps } from '@/Icon';
export type FormVariant = 'default' | 'block' | 'ghost' | 'pure';
export type ItemsType = 'group' | 'flat';

export const useStyles = createStyles(({ css, token, responsive }) => {
export const useStyles = createStyles(({ prefixCls, css, token, responsive }) => {
return {
blockStyle: css`
background: ${token.colorFillQuaternary};
Expand Down Expand Up @@ -47,6 +47,13 @@ export const useStyles = createStyles(({ css, token, responsive }) => {
padding: 16px;
background: ${token.colorBgLayout};
`,
pure: css`
.${prefixCls}-collapse-content-box {
.${prefixCls}-form-item:first-child {
border-block-start: 1px solid ${token.colorFillSecondary};
}
}
`,
pureStyle: css`
padding: 0;
background: transparent;
Expand Down Expand Up @@ -155,7 +162,7 @@ const FormGroup = memo<FormGroupProps>(
return (
<Collapse
activeKey={isUndefined(active) ? undefined : active ? [keyValue] : []}
className={cx(groupClassName, className)}
className={cx(groupClassName, variant === 'pure' && styles.pure, className)}
collapsible={defaultCollapsible}
defaultActiveKey={defaultActive ? [keyValue] : undefined}
items={[
Expand Down
5 changes: 0 additions & 5 deletions src/Form/style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,6 @@ export const useStyles = createStyles(({ css, token, prefixCls, responsive }) =>
`,
pure: css`
gap: 64px;
.${prefixCls}-collapse-content-box {
.${prefixCls}-form-item:first-child {
border-block-start: 1px solid ${token.colorFillSecondary};
}
}
${responsive.mobile} {
border-block-start: unset;
}
Expand Down

0 comments on commit 69ec600

Please sign in to comment.