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.
Files changed (2) hide show
  1. package/Details.astro +6 -3
  2. 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"><slot name="title" /></span>
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: 1px solid var(--abt-details-border, #d1d5db);
50
+ border-bottom-color: var(--abt-details-separator, var(--abt-details-border, #d1d5db));
48
51
  }
49
52
 
50
53
  .abt-details-title {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "astro-better-details",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "type": "module",
5
5
  "description": "Expandable details/disclosure component for Astro",
6
6
  "author": "Nathan Contino <ncontino@lambdalatitudinarians.org>",