2021-06-23 17:11:19 +02:00
|
|
|
<!--
|
|
|
|
Copyright: Ankitects Pty Ltd and contributors
|
|
|
|
License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|
|
|
-->
|
2021-10-26 00:43:02 +02:00
|
|
|
<script lang="ts">
|
2021-11-17 04:49:52 +01:00
|
|
|
import Container from "./Container.svelte";
|
|
|
|
import type { Breakpoint } from "./types";
|
|
|
|
|
2021-06-23 17:11:19 +02:00
|
|
|
export let id: string | undefined = undefined;
|
|
|
|
let className: string = "";
|
|
|
|
export { className as class };
|
2021-07-06 16:43:08 +02:00
|
|
|
|
2021-09-15 15:21:37 +02:00
|
|
|
export let height: number = 0;
|
2021-11-17 04:49:52 +01:00
|
|
|
export let breakpoint: Breakpoint | "fluid" = "fluid";
|
2021-06-23 17:11:19 +02:00
|
|
|
</script>
|
|
|
|
|
2021-11-17 04:49:52 +01:00
|
|
|
<div {id} bind:offsetHeight={height} class="sticky-container {className}">
|
2022-02-03 05:52:11 +01:00
|
|
|
<Container {breakpoint}>
|
2021-11-17 04:49:52 +01:00
|
|
|
<slot />
|
|
|
|
</Container>
|
|
|
|
</div>
|
2021-06-23 17:11:19 +02:00
|
|
|
|
|
|
|
<style lang="scss">
|
2021-11-17 04:49:52 +01:00
|
|
|
.sticky-container {
|
2021-09-15 15:21:37 +02:00
|
|
|
position: sticky;
|
2021-12-04 05:53:16 +01:00
|
|
|
top: var(--sticky-top, 0);
|
2021-11-17 04:49:52 +01:00
|
|
|
bottom: 0;
|
2021-06-23 17:11:19 +02:00
|
|
|
left: 0;
|
|
|
|
right: 0;
|
2022-09-05 09:20:00 +02:00
|
|
|
z-index: 50;
|
2021-06-23 17:11:19 +02:00
|
|
|
|
2021-11-24 03:09:55 +01:00
|
|
|
background: var(--sticky-bg, var(--window-bg));
|
2021-10-18 14:01:15 +02:00
|
|
|
border-style: solid;
|
2021-11-24 03:09:55 +01:00
|
|
|
border-color: var(--sticky-border, var(--medium-border));
|
2021-11-17 04:49:52 +01:00
|
|
|
border-width: var(--sticky-borders, 0);
|
2021-06-23 17:11:19 +02:00
|
|
|
}
|
|
|
|
</style>
|