From b892794e069dead426ebbaa3263da92f714bf136 Mon Sep 17 00:00:00 2001 From: Bryce Gilhome Date: Thu, 12 Dec 2024 13:52:19 +1100 Subject: [PATCH 1/4] Use a responsively hidden div instead of pseudo-element content to show data table cell label on mobile. --- .../src/components/data-table/RplDataTable.css | 11 +++++++---- .../src/components/data-table/RplDataTableRow.vue | 3 ++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/packages/ripple-ui-core/src/components/data-table/RplDataTable.css b/packages/ripple-ui-core/src/components/data-table/RplDataTable.css index 389375d301..b47bc83b4d 100644 --- a/packages/ripple-ui-core/src/components/data-table/RplDataTable.css +++ b/packages/ripple-ui-core/src/components/data-table/RplDataTable.css @@ -83,6 +83,10 @@ } } } + + &__mobile-label { + display: none; + } } .rpl-data-table--mobile { @@ -151,9 +155,8 @@ } } - [data-label]::before { + .rpl-data-table__mobile-label { font-weight: var(--rpl-type-weight-bold); - content: attr(data-label); display: block; margin-bottom: var(--rpl-sp-1); } @@ -166,8 +169,8 @@ line-height: var(--rpl-type-lh-4); letter-spacing: var(--rpl-type-ls-1); - &[data-label]::before { - content: ''; + .rpl-data-table__mobile-label { + display: none; } } } diff --git a/packages/ripple-ui-core/src/components/data-table/RplDataTableRow.vue b/packages/ripple-ui-core/src/components/data-table/RplDataTableRow.vue index 812ee7d09c..d9da2e2692 100644 --- a/packages/ripple-ui-core/src/components/data-table/RplDataTableRow.vue +++ b/packages/ripple-ui-core/src/components/data-table/RplDataTableRow.vue @@ -114,8 +114,9 @@ const getCellText = (col?: number | string, value = '') => { :is="i === 0 && verticalHeader ? 'th' : 'td'" v-for="(column, i) of columns" :key="i" - :data-label="column.label" > +
+
{{ column.label }}