Skip to content

Commit 8009cd3

Browse files
author
Alessandra Davila
authored
docs(data-table): add storybook book expandable demo styles (#5034)
1 parent 8faf1f7 commit 8009cd3

File tree

3 files changed

+29
-5
lines changed

3 files changed

+29
-5
lines changed

packages/components/src/components/data-table/_data-table-expandable.scss

-2
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,6 @@
6363
}
6464

6565
tr.#{$prefix}--parent-row.#{$prefix}--expandable-row + tr[data-child-row] td {
66-
padding-bottom: rem(23px);
67-
transition: padding $duration--moderate-01 motion(standard, productive);
6866
border-bottom: 1px solid $ui-03;
6967
}
7068

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
@import '~@carbon/type/scss/type';
2+
@import '~@carbon/themes/scss/themes';
3+
4+
.demo-expanded-td td {
5+
padding-left: 3.25rem !important;
6+
padding-bottom: 1.5rem;
7+
padding-top: 1rem;
8+
}
9+
10+
.demo-inner-container-header {
11+
@include carbon--type-style('productive-heading-01');
12+
color: $text-01;
13+
}
14+
15+
.demo-inner-container-content {
16+
@include carbon--type-style('body-long-01');
17+
color: $text-02;
18+
}

packages/react/src/components/DataTable/stories/with-expansion.js

+11-3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
* LICENSE file in the root directory of this source tree.
66
*/
77

8+
import './datatable-story.scss';
9+
810
import React from 'react';
911
import DataTable, {
1012
Table,
@@ -56,9 +58,15 @@ export default props => (
5658
<TableCell key={cell.id}>{cell.value}</TableCell>
5759
))}
5860
</TableExpandRow>
59-
<TableExpandedRow colSpan={headers.length + 1}>
60-
<h1>Expandable row content</h1>
61-
<p>Description here</p>
61+
<TableExpandedRow
62+
colSpan={headers.length + 1}
63+
className="demo-expanded-td">
64+
<h1 className="demo-inner-container-header">
65+
Expandable row content
66+
</h1>
67+
<p className="demo-inner-container-content">
68+
Description here
69+
</p>
6270
</TableExpandedRow>
6371
</React.Fragment>
6472
))}

0 commit comments

Comments
 (0)