Skip to content

Commit

Permalink
Merge pull request #6018 from getkirby/fix/6016-scroll-top
Browse files Browse the repository at this point in the history
Fixes for sticky table headers
  • Loading branch information
bastianallgeier authored Nov 30, 2023
2 parents ea94126 + cb7d407 commit 31ac829
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
6 changes: 6 additions & 0 deletions panel/lab/components/blocks/table/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,9 @@
</k-lab-example>
</k-lab-examples>
</template>

<style>
.k-lab-examples {
padding-bottom: 100rem;
}
</style>
4 changes: 1 addition & 3 deletions panel/src/components/Forms/Blocks/Types/Table.vue
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,8 @@ export default {
border: 1px solid var(--color-gray-300);
border-spacing: 0;
border-radius: var(--rounded-sm);
overflow: hidden;
}
.k-block-type-table-preview td,
.k-block-type-table-preview th {
.k-block-type-table-preview :where(th, td) {
text-align: start;
line-height: 1.5em;
font-size: var(--text-sm);
Expand Down
4 changes: 2 additions & 2 deletions panel/src/components/Layout/Header.vue
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export default {
:root {
--header-color-back: var(--color-light);
--header-padding-block: var(--spacing-4);
--header-sticky-offset: calc(var(--scroll-top, 0rem) + 4rem);
--header-sticky-offset: calc(var(--scroll-top) + 4rem);
}
.k-header {
Expand Down Expand Up @@ -161,7 +161,7 @@ export default {
/** TODO: .k-header:has(.k-header-buttons) */
.k-header[data-has-buttons="true"] {
position: sticky;
top: var(--scroll-top, 0);
top: var(--scroll-top);
z-index: var(--z-toolbar);
}
</style>
4 changes: 4 additions & 0 deletions panel/src/components/View/Panel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ export default {};
</script>

<style>
:root {
--scroll-top: 0rem;
}
html {
overflow-x: hidden;
overflow-y: scroll;
Expand Down

0 comments on commit 31ac829

Please sign in to comment.