astro-better-details 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Details.astro +6 -3
- package/package.json +1 -1
package/Details.astro
CHANGED
|
@@ -2,14 +2,15 @@
|
|
|
2
2
|
interface Props {
|
|
3
3
|
open?: boolean;
|
|
4
4
|
class?: string;
|
|
5
|
+
title?: string;
|
|
5
6
|
}
|
|
6
7
|
|
|
7
|
-
const { open, class: cls } = Astro.props;
|
|
8
|
+
const { open, class: cls, title } = Astro.props;
|
|
8
9
|
---
|
|
9
10
|
|
|
10
11
|
<details class:list={['abt-details', cls]} open={open}>
|
|
11
12
|
<summary class="abt-details-summary">
|
|
12
|
-
<span class="abt-details-title"
|
|
13
|
+
<span class="abt-details-title">{title}<slot name="title" /></span>
|
|
13
14
|
<svg class="abt-details-chevron" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
|
|
14
15
|
<path fill-rule="evenodd" d="M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z" clip-rule="evenodd" />
|
|
15
16
|
</svg>
|
|
@@ -38,13 +39,15 @@ const { open, class: cls } = Astro.props;
|
|
|
38
39
|
background: var(--abt-details-summary-bg, #f9fafb);
|
|
39
40
|
font-weight: 500;
|
|
40
41
|
user-select: none;
|
|
42
|
+
/* always present so open/close is a color-only change -- no layout shift */
|
|
43
|
+
border-bottom: 1px solid transparent;
|
|
41
44
|
}
|
|
42
45
|
|
|
43
46
|
.abt-details-summary::-webkit-details-marker { display: none; }
|
|
44
47
|
.abt-details-summary::marker { display: none; }
|
|
45
48
|
|
|
46
49
|
.abt-details[open] > .abt-details-summary {
|
|
47
|
-
border-bottom:
|
|
50
|
+
border-bottom-color: var(--abt-details-separator, var(--abt-details-border, #d1d5db));
|
|
48
51
|
}
|
|
49
52
|
|
|
50
53
|
.abt-details-title {
|