Skip to content

Commit df9651a

Browse files
committed
reimplement banner
1 parent 96fe901 commit df9651a

File tree

1 file changed

+24
-15
lines changed

1 file changed

+24
-15
lines changed

sites/kit.svelte.dev/src/routes/__layout.svelte

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@
55
import { Icon, Icons, Nav, NavItem, PreloadingIndicator, SkipLink } from '@sveltejs/site-kit';
66
import Search from '$lib/search/Search.svelte';
77
import SearchBox from '$lib/search/SearchBox.svelte';
8-
9-
let h = 0;
10-
let w = 0;
11-
$: browser && document.documentElement.style.setProperty('--ukr-footer-height', `${h}px`);
128
</script>
139

1410
<Icons />
@@ -48,7 +44,7 @@
4844
</svelte:fragment>
4945
</Nav>
5046

51-
<main id="main" style="padding-bottom: {h}px;">
47+
<main id="main">
5248
<slot />
5349

5450
{#if browser}
@@ -57,14 +53,13 @@
5753
</main>
5854

5955
<a target="_blank" rel="noopener noreferrer" href="https://www.stopputin.net/">
60-
<div class="ukr" bind:clientHeight={h} bind:clientWidth={w}>
61-
{#if w < 830}
62-
<strong>We stand with Ukraine.</strong>
63-
Donate →
64-
{:else}
65-
<strong>We stand with Ukraine.</strong>
66-
Petition your leaders. Show your support.
67-
{/if}
56+
<div class="ukr">
57+
<span class="small">
58+
<strong>We stand with Ukraine.</strong> Donate →
59+
</span>
60+
<span class="large">
61+
<strong>We stand with Ukraine.</strong> Petition your leaders. Show your support.
62+
</span>
6863
</div>
6964
</a>
7065

@@ -137,22 +132,36 @@
137132
font-size: 1.6rem !important;
138133
}
139134
135+
/** Ukraine banner */
136+
:root {
137+
--ukr-footer-height: 48px;
138+
}
139+
140+
main {
141+
padding-bottom: var(--ukr-footer-height);
142+
}
143+
140144
.ukr {
141145
background-color: #0066cc;
142146
color: white;
143147
position: fixed;
148+
display: flex;
149+
align-items: center;
150+
justify-content: center;
144151
bottom: 0;
145152
width: 100vw;
146-
text-align: center;
147-
padding: 0.75em;
153+
height: var(--ukr-footer-height);
148154
z-index: 999;
149155
}
156+
150157
:global(.examples-container, .repl-outer, .tutorial-outer) {
151158
height: calc(100vh - var(--nav-h) - var(--ukr-footer-height)) !important;
152159
}
160+
153161
:global(.toggle) {
154162
bottom: var(--ukr-footer-height) !important;
155163
}
164+
156165
@media (max-width: 830px) {
157166
:global(aside) {
158167
z-index: 9999 !important;

0 commit comments

Comments
 (0)