From d4d43ce20a8a8860c9e39b971f671cc9a34fbd32 Mon Sep 17 00:00:00 2001 From: Mark Drastrup Date: Thu, 10 Nov 2022 15:26:58 +0900 Subject: [PATCH 1/3] Refactor table cell styling to ensure a default height of 44px --- .../src/lib/components/data-table/table/table.component.scss | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libs/designsystem/src/lib/components/data-table/table/table.component.scss b/libs/designsystem/src/lib/components/data-table/table/table.component.scss index ca5b09d8e9..17e1258a00 100644 --- a/libs/designsystem/src/lib/components/data-table/table/table.component.scss +++ b/libs/designsystem/src/lib/components/data-table/table/table.component.scss @@ -40,7 +40,8 @@ th { } td { - padding: utils.size('s'); + height: 44px; + padding: utils.size('xxxs') utils.size('s'); font-weight: utils.font-weight('normal'); font-size: utils.font-size('s'); color: utils.get-text-color('black'); From 62436a0aa99f1ed8864febe4390d0f0fc7f7b63f Mon Sep 17 00:00:00 2001 From: Mark Drastrup Date: Thu, 10 Nov 2022 15:34:25 +0900 Subject: [PATCH 2/3] Update test for table cell styling --- .../src/lib/components/data-table/table/table.component.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/designsystem/src/lib/components/data-table/table/table.component.spec.ts b/libs/designsystem/src/lib/components/data-table/table/table.component.spec.ts index a665b69d96..09c3dff541 100644 --- a/libs/designsystem/src/lib/components/data-table/table/table.component.spec.ts +++ b/libs/designsystem/src/lib/components/data-table/table/table.component.spec.ts @@ -61,7 +61,7 @@ describe('TableComponent', () => { it('should style [tbody] cells correctly', () => { expect(element.children.namedItem('tbody').firstChild.firstChild).toHaveComputedStyle({ - padding: `${size('s')}`, + padding: `${size('xxxs')} ${size('s')}`, 'font-weight': fontWeight('normal'), 'font-size': fontSize('s'), color: getTextColor('black'), From 986bcc18861618db05749b6e376faf25434396b3 Mon Sep 17 00:00:00 2001 From: Mark Drastrup Date: Mon, 19 Dec 2022 11:02:37 +0100 Subject: [PATCH 3/3] Extract the cell height to a variable --- .../src/lib/components/data-table/table/table.component.scss | 5 ++++- package-lock.json | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/libs/designsystem/src/lib/components/data-table/table/table.component.scss b/libs/designsystem/src/lib/components/data-table/table/table.component.scss index 17e1258a00..2e06450282 100644 --- a/libs/designsystem/src/lib/components/data-table/table/table.component.scss +++ b/libs/designsystem/src/lib/components/data-table/table/table.component.scss @@ -1,6 +1,9 @@ @use '@kirbydesign/core/src/scss/utils'; @use '@kirbydesign/core/src/scss/interaction-state'; +// Height variables +$cell-height: 44px; + // Color variables $divider-color: utils.get-color('medium'); $highlight-color: utils.get-color('light'); @@ -40,7 +43,7 @@ th { } td { - height: 44px; + height: $cell-height; padding: utils.size('xxxs') utils.size('s'); font-weight: utils.font-weight('normal'); font-size: utils.font-size('s'); diff --git a/package-lock.json b/package-lock.json index b5bf81cf1f..bf6dc7cc8d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -129,7 +129,7 @@ }, "libs/core": { "name": "@kirbydesign/core", - "version": "0.0.37", + "version": "0.0.38", "dev": true, "license": "MIT" },