autogenerating sidebar links
This commit is contained in:
parent
1546fa8199
commit
6f5cbd21aa
13 changed files with 522 additions and 34 deletions
79
src/components/Box.astro
Normal file
79
src/components/Box.astro
Normal file
|
|
@ -0,0 +1,79 @@
|
|||
---
|
||||
import { getImage } from "astro:assets";
|
||||
import HoustonGrad from "~/assets/houston_grad.png";
|
||||
|
||||
export interface Props {
|
||||
icon?: "puzzle-piece" | "question-mark" | "check-list";
|
||||
}
|
||||
|
||||
const { icon } = Astro.props;
|
||||
---
|
||||
|
||||
<div
|
||||
class={`highlight-box content ${icon}`}
|
||||
style={icon === "question-mark" ? `--box-icon-url: url('nah');` : ""}
|
||||
>
|
||||
<section>
|
||||
<slot />
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
:global(section > *) + .highlight-box {
|
||||
margin: 4rem 0;
|
||||
}
|
||||
|
||||
.highlight-box {
|
||||
position: relative;
|
||||
padding-block: 2rem;
|
||||
padding-inline-start: 2rem;
|
||||
padding-inline-end: 4rem;
|
||||
border: 1px solid var(--sl-color-blue);
|
||||
background-color: var(--sl-color-blue-low);
|
||||
margin-top: 2.5rem !important;
|
||||
}
|
||||
|
||||
.highlight-box.check-list {
|
||||
border: 1px solid var(--sl-color-green);
|
||||
background-color: var(--sl-color-green-low);
|
||||
}
|
||||
@supports (mask: var(--box-icon-url) no-repeat center bottom / 100%) or
|
||||
(-webkit-mask: var(--box-icon-url) no-repeat center bottom / 100%) {
|
||||
.highlight-box::before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: -2.5rem;
|
||||
inset-inline-end: 1.5rem;
|
||||
width: 8rem;
|
||||
height: 8rem;
|
||||
background: var(--box-icon-url) no-repeat center center / 100%;
|
||||
}
|
||||
}
|
||||
|
||||
:global(ol) {
|
||||
padding-left: 1.5rem;
|
||||
}
|
||||
|
||||
.highlight-box :global(details) {
|
||||
--sl-details-border-color: var(--sl-color-purple);
|
||||
--sl-details-border-color--hover: var(--sl-color-purple-high);
|
||||
}
|
||||
|
||||
@media (max-width: 50em) {
|
||||
.highlight-box::before {
|
||||
width: 5rem;
|
||||
height: 5rem;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<style is:global>
|
||||
.highlight-box.question-mark .heading-wrapper:first-child {
|
||||
margin-inline-end: 6rem !important;
|
||||
}
|
||||
@media (max-width: 50em) {
|
||||
.highlight-box.question-mark .heading-wrapper:first-child {
|
||||
margin-inline-end: 3rem !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Loading…
Add table
Add a link
Reference in a new issue