| 1 |
/* -------------------------------------------------------------------------- |
| 2 |
Accordion |
| 3 |
-------------------------------------------------------------------------- */ |
| 4 |
.wpsubs-accordion__item { |
| 5 |
border: 1px solid var(--wpsubs-border, #e5e7eb); |
| 6 |
border-radius: var(--wpsubs-radius, 8px); |
| 7 |
background: var(--wpsubs-surface, #fff); |
| 8 |
margin-bottom: 10px; |
| 9 |
overflow: hidden; |
| 10 |
} |
| 11 |
|
| 12 |
.wpsubs-accordion__item:last-child { |
| 13 |
margin-bottom: 0; |
| 14 |
} |
| 15 |
|
| 16 |
.wpsubs-accordion__header { |
| 17 |
appearance: none; |
| 18 |
width: 100%; |
| 19 |
display: flex; |
| 20 |
align-items: center; |
| 21 |
justify-content: space-between; |
| 22 |
gap: 12px; |
| 23 |
border: none; |
| 24 |
background: var(--wpsubs-surface-muted, #f9fafb); |
| 25 |
margin: 0; |
| 26 |
padding: 14px 16px; |
| 27 |
font-size: 14px; |
| 28 |
font-weight: 600; |
| 29 |
color: var(--wpsubs-text, #374151); |
| 30 |
text-align: left; |
| 31 |
cursor: pointer; |
| 32 |
} |
| 33 |
|
| 34 |
.wpsubs-accordion__header:focus-visible { |
| 35 |
outline: 2px solid var(--wpsubs-brand-ring, rgba(255, 77, 0, 0.2)); |
| 36 |
outline-offset: -2px; |
| 37 |
} |
| 38 |
|
| 39 |
/* Chevron marker rotates when the section is open. */ |
| 40 |
.wpsubs-accordion__header::after { |
| 41 |
content: ""; |
| 42 |
flex: 0 0 auto; |
| 43 |
width: 8px; |
| 44 |
height: 8px; |
| 45 |
border-right: 2px solid var(--wpsubs-text-subtle, #9ca3af); |
| 46 |
border-bottom: 2px solid var(--wpsubs-text-subtle, #9ca3af); |
| 47 |
transform: rotate(45deg); |
| 48 |
transition: transform 0.15s ease; |
| 49 |
} |
| 50 |
|
| 51 |
.wpsubs-accordion__header[aria-expanded="true"]::after { |
| 52 |
transform: rotate(-135deg); |
| 53 |
} |
| 54 |
|
| 55 |
/* Chevron-on-the-left variant: marker sits before the title (points right when |
| 56 |
collapsed, down when open). Opt in with `--chevron-start`. */ |
| 57 |
.wpsubs-accordion__header--chevron-start { |
| 58 |
justify-content: flex-start; |
| 59 |
} |
| 60 |
|
| 61 |
.wpsubs-accordion__header--chevron-start::after { |
| 62 |
display: none; |
| 63 |
} |
| 64 |
|
| 65 |
.wpsubs-accordion__header--chevron-start::before { |
| 66 |
content: ""; |
| 67 |
order: -1; |
| 68 |
flex: 0 0 auto; |
| 69 |
width: 8px; |
| 70 |
height: 8px; |
| 71 |
border-right: 2px solid var(--wpsubs-text-subtle, #9ca3af); |
| 72 |
border-bottom: 2px solid var(--wpsubs-text-subtle, #9ca3af); |
| 73 |
transform: rotate(-45deg); |
| 74 |
transition: transform 0.15s ease; |
| 75 |
} |
| 76 |
|
| 77 |
.wpsubs-accordion__header--chevron-start[aria-expanded="true"]::before { |
| 78 |
transform: rotate(45deg); |
| 79 |
} |
| 80 |
|
| 81 |
.wpsubs-accordion__panel { |
| 82 |
padding: 16px; |
| 83 |
} |
| 84 |
|
| 85 |
.wpsubs-accordion__panel[hidden] { |
| 86 |
display: none; |
| 87 |
} |
| 88 |
|