Skip to content

Faq new style. #1107

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Apr 7, 2025
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions src/components/accordion/accordion.astro
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,26 @@ const { title, id } = Astro.props;
<summary
aria-expanded="false"
aria-controls={id}
class="cursor-pointer flex justify-between p-2 rounded-md border-t border-b focus:ring-2"
class="cursor-pointer flex justify-between p-2 bg-[#d4d5e5] focus:ring-2"
>
<span class="font-semibold">{title}</span>
<span aria-hidden="true" class="group-open:hidden">+</span>
<span aria-hidden="true" class="group-open:block hidden">−</span>
<span aria-hidden="true" class="group-open:hidden arrow">▼</span>
<span aria-hidden="true" class="group-open:block hidden arrow">▲</span>
</summary>

<div class="pl-4">
<slot />
</div>
</details>

<style>
details {
width:65ch;
}
.arrow {
font-size:25px;
line-height: 1.25;
}
</style>
<script>
document.addEventListener("DOMContentLoaded", () => {
const hash = window.location.hash.substring(1); // Remove #
Expand Down