Skip to content

Commit 892ddcd

Browse files
committed
fix spacing if promo-banner is visible
1 parent b16eece commit 892ddcd

4 files changed

Lines changed: 14 additions & 8 deletions

File tree

webui/src/assets/main.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ body {
3333
min-height: 100%;
3434
}
3535

36+
#app:has(header .promo-banner) {
37+
--header-height: calc(4rem + 22px);
38+
}
39+
3640
main {
3741
flex: 1;
3842
}

webui/src/assets/vars.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
:root{
2+
--header-height: 4rem;
3+
24
--color-background: #323743;
35
--color-background-mute: #2e2e31;
46
--color-background-soft: rgb(40,43,51);

webui/src/components/Header.vue

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -205,12 +205,12 @@ function navigateAndClose(params: Record<string, string>) {
205205
<header>
206206
<!-- Promotion banner -->
207207
<div class="promo-banner" v-if="isPromoEnabled && promo.activePromotion.value">
208-
<strong>Shop discount!</strong>
209-
Get <strong>{{ promo.activePromotion.value.discount }}% off</strong> Mokapi Gear
210-
<span class="d-none d-md-inline">
211-
support Mokapi with code in your heart and style on your sleeve.
208+
<strong class="d-none d-md-inline">Shop discount!</strong>
209+
Get <strong>{{ promo.activePromotion.value.discount }}% off</strong> Mokapi Gear
210+
<span class="d-none d-lg-inline">
211+
support Mokapi with code in your heart and style on your sleeve.
212212
</span>
213-
<a href="https://mokapi.myspreadshop.net" class="promo-link ms-2">Visit shop →</a>
213+
<a href="https://mokapi.myspreadshop.net" class="promo-link ms-1">Visit shop →</a>
214214
</div>
215215
<nav class="navbar navbar-expand-lg">
216216
<div class="container-fluid">
@@ -366,7 +366,7 @@ header {
366366
left: 0;
367367
z-index: 99;
368368
background-color: var(--color-background);
369-
height: 4rem;
369+
height: var(--header-height);
370370
display: block;
371371
}
372372
header .container-fluid {
@@ -379,7 +379,6 @@ header .container-fluid {
379379
text-align: center;
380380
padding: 0.5rem 1rem;
381381
font-size: 0.95rem;
382-
margin-bottom: 5px;
383382
}
384383
385384
.promo-banner strong {

webui/src/views/DocsView.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,9 +185,10 @@ function formatParam(label: any): string {
185185
.doc {
186186
margin-top: 20px;
187187
}
188+
188189
.sidebar {
189190
position: sticky;
190-
top: 4rem;
191+
top: var(--header-height);
191192
align-self: flex-start;
192193
width: 290px;
193194
padding-top: 2rem;

0 commit comments

Comments
 (0)