Skip to content

Commit

Permalink
Updates Table components data-attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
hellofanny committed May 12, 2022
1 parent fe3f8dd commit cecb71c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
10 changes: 5 additions & 5 deletions docs/docs/reference/ui/molecules/Table.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -116,14 +116,14 @@ All table-related components support all attributes also supported by their resp

`data-store-table`

`data-store-table-head`
`data-table-head`

`data-store-table-row`

`data-store-table-footer`
`data-table-footer`

`data-store-table-body`
`data-table-body`

`data-store-table-cell='head'`
`data-table-cell='head'`

`data-store-table-cell='data'`
`data-table-cell='data'`
2 changes: 1 addition & 1 deletion packages/ui/src/molecules/Table/Table.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ describe('Table', () => {
const tableCells = queryAllByTestId('store-table-cell')

// Make sure 8 cells were rendered and all contain the
// data-store-table-cell attribute.
// data-table-cell attribute.
expect(tableCells).toHaveLength(8)
tableCells.forEach((row) => {
expect(row).toHaveAttribute('data-table-cell')
Expand Down
14 changes: 7 additions & 7 deletions themes/theme-b2c-tailwind/src/molecules/table.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,30 @@
@apply table-auto divide-y divide-gray-200;
}

[data-store-table-head]{
[data-table-head]{
@apply bg-gray-50;
}

[data-store-table-body] {
[data-table-body] {
@apply bg-white divide-y divide-gray-200;
}

[data-store-table-cell="header"]{
[data-table-cell="header"]{
@apply px-6 py-3 text-left text-xs text-gray-900 font-bold uppercase tracking-wider;
}

[data-store-table-cell="data"]{
[data-table-cell="data"]{
@apply px-6 py-4;
}

[data-store-table-cell] > [data-store-price][data-selling] {
[data-table-cell] > [data-store-price][data-selling] {
@apply text-sm font-medium text-gray-900;
}

[data-store-table-footer]{
[data-table-footer]{
@apply bg-gray-50;
}

[data-store-table-footer] [data-store-table-cell="data"]{
[data-table-footer] [data-table-cell="data"]{
@apply px-6 py-3 text-left text-xs text-gray-900 font-bold uppercase tracking-wider;
}

0 comments on commit cecb71c

Please sign in to comment.