Skip to content
This repository has been archived by the owner on Sep 26, 2022. It is now read-only.

Commit

Permalink
fix(DataTable): the DataTable component now uses th properly
Browse files Browse the repository at this point in the history
  • Loading branch information
marekdedic committed Apr 7, 2021
1 parent 6b501a1 commit 839670d
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
<script>
import { getContext } from 'svelte';
let klass = '';
export { klass as class };
export let numeric = false;
const isTableHead = getContext('is-table-head') === true;
</script>

<style lang="scss" src="./DataTableCell.scss" global>
</style>

<td class="s-tbl-cell {klass}" class:numeric>
<slot />
</td>
{#if isTableHead}
<th class="s-tbl-cell {klass}" class:numeric>
<slot />
</th>
{:else}
<td class="s-tbl-cell {klass}" class:numeric>
<slot />
</td>
{/if}
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
<script>
import { setContext } from 'svelte';
let klass = '';
export { klass as class };
setContext('is-table-head', true);
</script>

<style lang="scss" src="./DataTableHead.scss" global>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@import './variables';

.s-tbl-row {
border-top-color: $tbl-border-color;
border-top-style: solid;
Expand Down

0 comments on commit 839670d

Please sign in to comment.