astro-contributors 0.5.0 → 0.6.0
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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# astro-contributors
|
|
2
2
|
|
|
3
|
+
## 0.6.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#72](https://github.com/trueberryless-org/astro-contributors/pull/72) [`a914cce`](https://github.com/trueberryless-org/astro-contributors/commit/a914ccee5dee7c0e3efaa360e7ac304d9e445163) Thanks [@trueberryless](https://github.com/trueberryless)! - Introduce flexible focus color to allow better control in raw Astro sites.
|
|
8
|
+
|
|
3
9
|
## 0.5.0
|
|
4
10
|
|
|
5
11
|
### Minor Changes
|
|
@@ -5,11 +5,16 @@ import FacePile from "./FacePile.astro";
|
|
|
5
5
|
export interface Props {
|
|
6
6
|
githubRepo?: `${string}/${string}`;
|
|
7
7
|
ignore?: string[];
|
|
8
|
+
focusColor?: string;
|
|
8
9
|
}
|
|
9
10
|
|
|
10
|
-
const {
|
|
11
|
+
const {
|
|
12
|
+
githubRepo = "withastro/docs",
|
|
13
|
+
ignore,
|
|
14
|
+
focusColor,
|
|
15
|
+
} = Astro.props as Props;
|
|
11
16
|
|
|
12
17
|
const contributors = await getAllContributors(githubRepo, ignore);
|
|
13
18
|
---
|
|
14
19
|
|
|
15
|
-
<FacePile {contributors} />
|
|
20
|
+
<FacePile {contributors} {focusColor} />
|
|
@@ -3,13 +3,14 @@ import type { Contributor } from "../libs/getContributors";
|
|
|
3
3
|
|
|
4
4
|
export interface Props {
|
|
5
5
|
contributors: Contributor[];
|
|
6
|
+
focusColor?: string;
|
|
6
7
|
}
|
|
7
8
|
|
|
8
|
-
const { contributors } = Astro.props as Props;
|
|
9
|
+
const { contributors, focusColor } = Astro.props as Props;
|
|
10
|
+
const styleOverride = focusColor ? { "--avatar-focus-color": focusColor } : {};
|
|
9
11
|
---
|
|
10
12
|
|
|
11
|
-
|
|
12
|
-
<div>
|
|
13
|
+
<div style={styleOverride}>
|
|
13
14
|
<ul class="avatar-list">
|
|
14
15
|
{
|
|
15
16
|
contributors.map((item) => (
|
|
@@ -38,6 +39,9 @@ const { contributors } = Astro.props as Props;
|
|
|
38
39
|
--avatar-outline-width: 1px;
|
|
39
40
|
--avatar-outline-offset: 0.08em;
|
|
40
41
|
|
|
42
|
+
/* Fallback chain: Global Var -> Component Prop -> Starlight Variable -> Default Blue */
|
|
43
|
+
--local-accent: var(--avatar-focus-color, var(--sl-color-accent, #3b82f6));
|
|
44
|
+
|
|
41
45
|
display: flex;
|
|
42
46
|
flex-wrap: wrap;
|
|
43
47
|
list-style: none;
|
|
@@ -75,13 +79,13 @@ const { contributors } = Astro.props as Props;
|
|
|
75
79
|
width: 100%;
|
|
76
80
|
height: 100%;
|
|
77
81
|
object-fit: cover;
|
|
78
|
-
background-color: var(--
|
|
82
|
+
background-color: var(--local-accent);
|
|
79
83
|
/* Indicates the contributor image boundaries for forced colors users, transparent is changed to a solid color */
|
|
80
84
|
outline: 1px solid transparent;
|
|
81
85
|
}
|
|
82
86
|
|
|
83
87
|
.avatar-list a:focus-visible {
|
|
84
|
-
outline: 2px solid var(--
|
|
88
|
+
outline: 2px solid var(--local-accent);
|
|
85
89
|
outline-offset: var(--avatar-outline-offset);
|
|
86
90
|
}
|
|
87
91
|
</style>
|