-
Notifications
You must be signed in to change notification settings - Fork 111
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
385 additions
and
402 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,3 +39,6 @@ indent_size = 4 | |
indent_style = space | ||
indent_size = 2 | ||
|
||
[**.astro] | ||
indent_size = 2 | ||
indent_style = space |
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,3 @@ | ||
{ | ||
"typescript.tsdk": "node_modules/typescript/lib" | ||
} |
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 |
---|---|---|
@@ -1,100 +1,96 @@ | ||
--- | ||
import type { Props } from "@astrojs/starlight/props"; | ||
import LanguageSelect from "@astrojs/starlight/components/LanguageSelect.astro"; | ||
import Search from "@astrojs/starlight/components/Search.astro"; | ||
import SiteTitle from "@astrojs/starlight/components/SiteTitle.astro"; | ||
import SocialIcons from "@astrojs/starlight/components/SocialIcons.astro"; | ||
import ThemeSelect from "@astrojs/starlight/components/ThemeSelect.astro"; | ||
const shouldRenderSearch = true; | ||
// import App from "./react/advancedButton.jsx"; | ||
import App from "./advancedButton.astro"; | ||
--- | ||
|
||
<div class="header sl-flex"> | ||
<div class="title-wrapper sl-flex"> | ||
<div class="toggle-global"> | ||
<App /> | ||
</div> | ||
<SiteTitle {...Astro.props} /> | ||
</div> | ||
<div class="sl-flex"> | ||
{shouldRenderSearch && <Search {...Astro.props} />} | ||
</div> | ||
<div class="sl-hidden md:sl-flex right-group"> | ||
<div class="sl-flex social-icons"> | ||
<SocialIcons {...Astro.props} /> | ||
</div> | ||
<ThemeSelect {...Astro.props} /> | ||
<LanguageSelect {...Astro.props} /> | ||
</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: hidden; | ||
} | ||
|
||
.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); | ||
} | ||
|
||
@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; | ||
} | ||
} | ||
</style> | ||
--- | ||
import type { Props } from "@astrojs/starlight/props"; | ||
import LanguageSelect from "@astrojs/starlight/components/LanguageSelect.astro"; | ||
import Search from "@astrojs/starlight/components/Search.astro"; | ||
import SiteTitle from "@astrojs/starlight/components/SiteTitle.astro"; | ||
import SocialIcons from "@astrojs/starlight/components/SocialIcons.astro"; | ||
import ThemeSelect from "@astrojs/starlight/components/ThemeSelect.astro"; | ||
const shouldRenderSearch = true; | ||
// import App from "./react/advancedButton.jsx"; | ||
import App from "./advancedButton.astro"; | ||
--- | ||
|
||
<div class="header sl-flex"> | ||
<div class="title-wrapper sl-flex"> | ||
<div class="toggle-global"> | ||
<App /> | ||
</div> | ||
<SiteTitle {...Astro.props} /> | ||
</div> | ||
<div class="sl-flex"> | ||
{shouldRenderSearch && <Search {...Astro.props} />} | ||
</div> | ||
<div class="sl-hidden md:sl-flex right-group"> | ||
<div class="sl-flex social-icons"> | ||
<SocialIcons {...Astro.props} /> | ||
</div> | ||
<ThemeSelect {...Astro.props} /> | ||
<LanguageSelect {...Astro.props} /> | ||
</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: hidden; | ||
} | ||
|
||
.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); | ||
} | ||
|
||
@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; | ||
} | ||
} | ||
</style> |
Oops, something went wrong.