-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Apply govuk styles to the browse scheme page
- Loading branch information
1 parent
0a1648b
commit 47c2c9a
Showing
3 changed files
with
38 additions
and
83 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 |
---|---|---|
@@ -1,53 +1,13 @@ | ||
<script lang="ts"> | ||
// TODO Lots of overlap with AccordionItem | ||
import { slide } from "svelte/transition"; | ||
export let label: string; | ||
export let open = false; | ||
</script> | ||
|
||
<button on:click={() => (open = !open)} aria-expanded={open} | ||
><svg | ||
style="tran" | ||
width="20" | ||
height="20" | ||
fill="none" | ||
stroke-linecap="round" | ||
stroke-linejoin="round" | ||
stroke-width="2" | ||
viewBox="0 0 24 24" | ||
stroke="currentColor"><path d="M9 5l7 7-7 7" /></svg | ||
> | ||
{label} | ||
</button> | ||
{#if open} | ||
<div transition:slide={{ duration: 100 }}> | ||
<details {open} class="govuk-details" data-module="govuk-details"> | ||
<summary class="govuk-details__summary"> | ||
<span class="govuk-details__summary-text">{label}</span> | ||
</summary> | ||
<div class="govuk-details__text"> | ||
<slot /> | ||
</div> | ||
{/if} | ||
|
||
<style> | ||
button { | ||
border: none; | ||
background: none; | ||
display: block; | ||
font-size: 20px; | ||
cursor: pointer; | ||
margin: 0; | ||
padding-bottom: 0.5em; | ||
padding-top: 0.5em; | ||
text-align: left; | ||
} | ||
button:hover { | ||
text-decoration: underline; | ||
} | ||
svg { | ||
transition: transform 0.2s ease-in; | ||
} | ||
[aria-expanded="true"] svg { | ||
transform: rotate(0.25turn); | ||
} | ||
</style> | ||
</details> |
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