-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: change homepage layout and add footer
- Loading branch information
Showing
8 changed files
with
197 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions
22
docs/tutorialkit.dev/src/components/Layout/PageFooter.astro
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<footer class="page-footer"> | ||
<a href="https://github.com/stackblitz/tutorialkit/blob/main/LICENSE" target="_blank">MIT License © 2024</a> | ||
<span><a href="https://webcontainers.io" target="_blank">Powered by WebContainers</a></span> | ||
</footer> | ||
|
||
<style> | ||
footer { | ||
width: 100%; | ||
padding: var(--sl-nav-pad-y) var(--sl-nav-pad-x); | ||
opacity: 0.7; | ||
font-size: 90%; | ||
position: relative; | ||
z-index: 10; | ||
text-align: center; | ||
display: flex; | ||
justify-content: space-between; | ||
} | ||
a { | ||
color: inherit; | ||
text-decoration: none; | ||
} | ||
</style> |
95 changes: 95 additions & 0 deletions
95
docs/tutorialkit.dev/src/components/Layout/PageFrame.astro
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
--- | ||
import MobileMenuToggle from 'virtual:starlight/components/MobileMenuToggle'; | ||
import PageFooter from './PageFooter.astro'; | ||
const { hasSidebar, labels } = Astro.props; | ||
--- | ||
|
||
<div class="page sl-flex"> | ||
<header class="header"><slot name="header" /></header> | ||
{ | ||
hasSidebar && ( | ||
<nav class="sidebar" aria-label={labels['sidebarNav.accessibleLabel']}> | ||
<MobileMenuToggle {...Astro.props} /> | ||
<div id="starlight__sidebar" class="sidebar-pane"> | ||
<div class="sidebar-content sl-flex"> | ||
<slot name="sidebar" /> | ||
</div> | ||
</div> | ||
</nav> | ||
) | ||
} | ||
<div class="main-frame"><slot /></div> | ||
<PageFooter /> | ||
</div> | ||
|
||
<style> | ||
.page { | ||
flex-direction: column; | ||
min-height: 100vh; | ||
} | ||
|
||
.header { | ||
z-index: var(--sl-z-index-navbar); | ||
position: fixed; | ||
inset-inline-start: 0; | ||
inset-block-start: 0; | ||
width: 100%; | ||
height: var(--sl-nav-height); | ||
border-bottom: 1px solid var(--sl-color-hairline-shade); | ||
padding: var(--sl-nav-pad-y) var(--sl-nav-pad-x); | ||
padding-inline-end: var(--sl-nav-pad-x); | ||
background-color: var(--sl-color-bg-nav); | ||
} | ||
|
||
:global([data-has-sidebar]) .header { | ||
padding-inline-end: calc(var(--sl-nav-gap) + var(--sl-nav-pad-x) + var(--sl-menu-button-size)); | ||
} | ||
|
||
.sidebar-pane { | ||
visibility: var(--sl-sidebar-visibility, hidden); | ||
position: fixed; | ||
z-index: var(--sl-z-index-menu); | ||
inset-block: var(--sl-nav-height) 0; | ||
inset-inline-start: 0; | ||
width: 100%; | ||
background-color: var(--sl-color-black); | ||
overflow-y: auto; | ||
} | ||
|
||
:global([aria-expanded='true']) ~ .sidebar-pane { | ||
--sl-sidebar-visibility: visible; | ||
} | ||
|
||
.sidebar-content { | ||
height: 100%; | ||
min-height: max-content; | ||
padding: 1rem var(--sl-sidebar-pad-x) 0; | ||
flex-direction: column; | ||
gap: 1rem; | ||
} | ||
|
||
@media (min-width: 50rem) { | ||
.sidebar-content::after { | ||
content: ''; | ||
padding-bottom: 1px; | ||
} | ||
} | ||
|
||
.main-frame { | ||
padding-top: calc(var(--sl-nav-height) + var(--sl-mobile-toc-height)); | ||
padding-inline-start: var(--sl-content-inline-start); | ||
} | ||
|
||
@media (min-width: 50rem) { | ||
:global([data-has-sidebar]) .header { | ||
padding-inline-end: var(--sl-nav-pad-x); | ||
} | ||
.sidebar-pane { | ||
--sl-sidebar-visibility: visible; | ||
width: var(--sl-sidebar-width); | ||
background-color: var(--sl-color-bg-sidebar); | ||
border-inline-end: 1px solid var(--sl-color-hairline-shade); | ||
} | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// allows the use of import config from 'virtual:starlight/components/MobileMenuToggle'; in frontmatter | ||
|
||
declare module 'virtual:starlight/components/MobileMenuToggle' { | ||
const component: any; | ||
|
||
export default component; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters