-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update aastro config and decode calldata (#198)
- Loading branch information
1 parent
7970424
commit 8775211
Showing
6 changed files
with
166 additions
and
93 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
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,129 @@ | ||
--- | ||
import config from 'virtual:starlight/user-config'; | ||
import LanguageSelect from 'virtual:starlight/components/LanguageSelect'; | ||
import Search from 'virtual:starlight/components/Search'; | ||
import SiteTitle from 'virtual:starlight/components/SiteTitle'; | ||
import SocialIcons from 'virtual:starlight/components/SocialIcons'; | ||
import ThemeSelect from 'virtual:starlight/components/ThemeSelect'; | ||
/** | ||
* Render the `Search` component if Pagefind is enabled or the default search component has been overridden. | ||
*/ | ||
const isHomePage = Astro.url.pathname === '/'; | ||
const shouldRenderSearch = | ||
!isHomePage && | ||
(config.pagefind || config.components.Search !== '@astrojs/starlight/components/Search.astro'); | ||
--- | ||
|
||
<div class="header sl-flex"> | ||
<div class="title-wrapper sl-flex"> | ||
<SiteTitle {...Astro.props}/> | ||
</div> | ||
<div class="sl-flex"> | ||
{shouldRenderSearch && | ||
<Search {...Astro.props}/>} | ||
</div> | ||
<div class="sl-hidden md:sl-flex right-group"> | ||
<div class="external-link"> | ||
<a class="external-link-text" href="https://loop-decoder-web.vercel.app" data-color-scheme="no-preference: light; light: light; dark: dark;"> | ||
<span>Playground</span> | ||
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"> | ||
<path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path> | ||
<polyline points="15 3 21 3 21 9"></polyline> | ||
<line x1="10" y1="14" x2="21" y2="3"></line> | ||
</svg> | ||
</a> | ||
</div> | ||
<div class="sl-flex social-icons"> | ||
<SocialIcons {...Astro.props}/> | ||
</div> | ||
<ThemeSelect {...Astro.props}/> | ||
<LanguageSelect {...Astro.props}/> | ||
<!-- Place this tag where you want the button to render. --> | ||
|
||
</div> | ||
</div> | ||
|
||
<style> | ||
.header { | ||
gap: var(--sl-nav-gap); | ||
justify-content: space-between; | ||
align-items: center; | ||
height: 100%; | ||
} | ||
|
||
.title-wrapper { | ||
/* Prevent long titles overflowing and covering the search and menu buttons on narrow viewports. */ | ||
overflow: clip; | ||
/* Avoid clipping focus ring around link inside title wrapper. */ | ||
padding: 0.25rem; | ||
margin: -0.25rem; | ||
} | ||
|
||
.right-group, | ||
.social-icons { | ||
gap: 1rem; | ||
align-items: center; | ||
} | ||
.social-icons::after { | ||
content: ''; | ||
height: 2rem; | ||
border-inline-end: 1px solid var(--sl-color-gray-5); | ||
} | ||
|
||
.external-link { | ||
height: 28px; | ||
} | ||
|
||
@media (min-width: 50rem) { | ||
:global(:root[data-has-sidebar]) { | ||
--__sidebar-pad: calc(2 * var(--sl-nav-pad-x)); | ||
} | ||
:global(:root:not([data-has-toc])) { | ||
--__toc-width: 0rem; | ||
} | ||
.header { | ||
--__sidebar-width: max(0rem, var(--sl-content-inline-start, 0rem) - var(--sl-nav-pad-x)); | ||
--__main-column-fr: calc( | ||
( | ||
100% + var(--__sidebar-pad, 0rem) - var(--__toc-width, var(--sl-sidebar-width)) - | ||
(2 * var(--__toc-width, var(--sl-nav-pad-x))) - var(--sl-content-inline-start, 0rem) - | ||
var(--sl-content-width) | ||
) / 2 | ||
); | ||
display: grid; | ||
grid-template-columns: | ||
/* 1 (site title): runs up until the main content column’s left edge or the width of the title, whichever is the largest */ | ||
minmax( | ||
calc(var(--__sidebar-width) + max(0rem, var(--__main-column-fr) - var(--sl-nav-gap))), | ||
auto | ||
) | ||
/* 2 (search box): all free space that is available. */ | ||
1fr | ||
/* 3 (right items): use the space that these need. */ | ||
auto; | ||
align-content: center; | ||
} | ||
} | ||
|
||
.external-link-text { | ||
display: inline-flex; | ||
align-items: center; | ||
gap: 0.4rem; | ||
color: var(--sl-color-text-accent); | ||
text-decoration: none; | ||
font-weight: 500; | ||
transition: color 0.2s ease; | ||
} | ||
|
||
.external-link-text:hover { | ||
color: var(--sl-color-text); | ||
} | ||
|
||
.external-link-text svg { | ||
width: 0.9em; | ||
height: 0.9em; | ||
} | ||
</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
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