forked from withastro/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Make fallback notice sticky & dismissible"
This reverts commit 81fff11.
- Loading branch information
Showing
2 changed files
with
4 additions
and
70 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 |
---|---|---|
@@ -1,73 +1,9 @@ | ||
--- | ||
import Aside from './Aside.astro'; | ||
import UIString from './UIString.astro'; | ||
import { useTranslations } from '../i18n/util'; | ||
const t = useTranslations(Astro); | ||
--- | ||
|
||
<div class="fallback-notice"> | ||
<input type="checkbox" id="fallback-notice-close-checkbox" class="sr-only" aria-hidden="true"> | ||
<label for="fallback-notice-close-checkbox" aria-hidden="true"> | ||
<UIString key="fallbackContent.closeLabel" /> | ||
</label> | ||
<Aside type="caution" title={t('fallbackContent.title')}> | ||
<UIString key="fallbackContent.notice" /> | ||
<a href="https://github.com/withastro/docs/blob/main/src/i18n#readme"> | ||
<UIString key="fallbackContent.linkText" /> | ||
</a> | ||
</Aside> | ||
</div> | ||
|
||
<style> | ||
.fallback-notice { | ||
position: fixed; | ||
bottom: .5rem; | ||
left: 50%; | ||
transform: translateX(-50%); | ||
width: calc(100% - 1rem); | ||
max-width: 35rem; | ||
z-index: 5; | ||
background: var(--theme-bg-gradient-bottom); | ||
} | ||
|
||
@media (min-width: 37.75em) { | ||
.fallback-notice { | ||
bottom: 1.5rem; | ||
z-index: 50; | ||
} | ||
} | ||
|
||
@media (min-width: 50em) { | ||
.fallback-notice { | ||
bottom: 2.5rem; | ||
} | ||
} | ||
|
||
.fallback-notice :global(aside) { | ||
box-shadow: 0 0 var(--theme-glow-blur) var(--theme-glow-diffuse); | ||
} | ||
|
||
label { | ||
position: absolute; | ||
top: 0; | ||
right: 0; | ||
font-size: .875rem; | ||
padding: .375rem .625rem; | ||
color: var(--theme-text-lighter); | ||
} | ||
|
||
:global(.theme-dark) label { | ||
color: var(--theme-text); | ||
} | ||
|
||
/* Highlight label for keyboard users */ | ||
input[type="checkbox"]:focus-visible~label { | ||
outline: 2px solid currentColor; | ||
} | ||
|
||
/* Hide fallback notice when checkbox is checked */ | ||
input[type="checkbox"]:checked, | ||
input[type="checkbox"]:checked~ :global(*) { | ||
display: none | ||
} | ||
</style> | ||
<Aside> | ||
<UIString key="fallbackContent.notice" /> | ||
<a href="https://github.com/withastro/docs/blob/main/src/i18n#readme"><UIString key="fallbackContent.linkText" /></a> | ||
</Aside> |
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