Skip to content

Commit

Permalink
Include ‘gap’ in class names for Row and Column
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentSmedinga committed Jul 19, 2024
1 parent 0cddd8a commit 296cd23
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion packages/css/src/components/column/column.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
}

@each $size, $label in $ams-sizes {
.ams-column--#{$label} {
.ams-column--gap-#{$label} {
gap: var(--ams-column-gap-#{$size});
}
}
2 changes: 1 addition & 1 deletion packages/css/src/components/row/row.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
}

@each $size, $label in $ams-sizes {
.ams-row--#{$label} {
.ams-row--gap-#{$label} {
gap: var(--ams-row-gap-#{$size});
}
}
Expand Down
7 changes: 4 additions & 3 deletions packages/react/src/Column/Column.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ describe('Column', () => {

const component = container.querySelector(':only-child')

expect(component).toHaveClass('ams-column--medium')
expect(component).toHaveClass('ams-column')
expect(component).toHaveClass('ams-column--gap-medium')
})

columnGapSizes.map((size) =>
Expand All @@ -27,7 +28,7 @@ describe('Column', () => {

const component = container.querySelector(':only-child')

expect(component).toHaveClass(`ams-column--${size}`)
expect(component).toHaveClass(`ams-column--gap-${size}`)
}),
)

Expand All @@ -36,7 +37,7 @@ describe('Column', () => {

const component = container.querySelector(':only-child')

expect(component).toHaveClass('ams-column--medium extra')
expect(component).toHaveClass('ams-column extra')
})

it('renders with an article tag', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/Column/Column.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export type ColumnProps = {

export const Column = forwardRef(
({ as: Tag = 'div', children, className, gap = 'medium', ...restProps }: ColumnProps, ref: any) => (
<Tag {...restProps} ref={ref} className={clsx('ams-column', `ams-column--${gap}`, className)}>
<Tag {...restProps} ref={ref} className={clsx('ams-column', `ams-column--gap-${gap}`, className)}>
{children}
</Tag>
),
Expand Down
7 changes: 4 additions & 3 deletions packages/react/src/Row/Row.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ describe('Row', () => {

const component = container.querySelector(':only-child')

expect(component).toHaveClass('ams-row--medium')
expect(component).toHaveClass('ams-row')
expect(component).toHaveClass('ams-row--gap-medium')
})

rowGapSizes.map((size) =>
Expand All @@ -28,7 +29,7 @@ describe('Row', () => {

const component = container.querySelector(':only-child')

expect(component).toHaveClass(`ams-row--${size}`)
expect(component).toHaveClass(`ams-row--gap-${size}`)
}),
)

Expand All @@ -37,7 +38,7 @@ describe('Row', () => {

const component = container.querySelector(':only-child')

expect(component).toHaveClass('ams-row--medium extra')
expect(component).toHaveClass('ams-row extra')
})

it('renders with an article tag', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/Row/Row.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export const Row = forwardRef(
ref={ref}
className={clsx(
'ams-row',
`ams-row--${gap}`,
`ams-row--gap-${gap}`,
align && `ams-row--align-${align}`,
alignVertical && `ams-row--align-vertical-${alignVertical}`,
wrap && 'ams-row--wrap',
Expand Down

0 comments on commit 296cd23

Please sign in to comment.