@hoangyell/gallery 1.0.0 → 1.0.5

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/README.md CHANGED
@@ -2,6 +2,28 @@
2
2
 
3
3
  [Astro](https://astro.build/) image gallery component with lightbox, pyramid multi-row layout, and accessible controls.
4
4
 
5
+ **Live demo → [gallery.hoangyell.com](https://gallery.hoangyell.com)**
6
+
7
+ <p align="center">
8
+ <a href="https://gallery.hoangyell.com">
9
+ <img
10
+ src="https://raw.githubusercontent.com/HoangYell/hoangyell-gallery/main/packages/astro/docs/site-hero.jpg"
11
+ alt="@hoangyell/gallery landing page hero — The friendly Astro image gallery"
12
+ width="720"
13
+ />
14
+ </a>
15
+ </p>
16
+
17
+ <p align="center">
18
+ <em>Click any image to open the lightbox — keyboard arrows, swipe, ESC to close.</em>
19
+ <br />
20
+ <img
21
+ src="https://raw.githubusercontent.com/HoangYell/hoangyell-gallery/main/packages/astro/docs/gallery-lightbox.jpg"
22
+ alt="Lightbox view with page indicator, close button, and next-image arrow"
23
+ width="640"
24
+ />
25
+ </p>
26
+
5
27
  ## Features
6
28
 
7
29
  - **Pyramid layout** — distribute images across rows with `rows` prop
@@ -60,6 +82,16 @@ import { Gallery } from "@hoangyell/gallery";
60
82
  | `fit` | `ObjectFit` | `"cover"` | Default CSS object-fit |
61
83
  | `class` | `string` | — | Extra wrapper class |
62
84
 
85
+ ## Dark mode
86
+
87
+ The component auto-themes via three mechanisms (last one wins):
88
+
89
+ 1. `prefers-color-scheme: dark` — OS preference (default).
90
+ 2. `<html class="dark">` or `<html data-theme="dark">` — Tailwind-style class toggle.
91
+ 3. `<html class="light">` or `<html data-theme="light">` — explicit light theme override.
92
+
93
+ This means it Just Works™ with manual theme toggles **and** OS preference.
94
+
63
95
  ## Customization
64
96
 
65
97
  Override CSS custom properties on `.hy-gallery`:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hoangyell/gallery",
3
- "version": "1.0.0",
3
+ "version": "1.0.5",
4
4
  "description": "Astro image gallery with lightbox, pyramid multi-row layout, and accessible controls.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -23,7 +23,7 @@
23
23
  "photo-gallery"
24
24
  ],
25
25
  "author": "Hoang Yell <hoangyell@gmail.com> (https://hoangyell.com)",
26
- "homepage": "https://github.com/HoangYell/hoangyell-gallery#readme",
26
+ "homepage": "https://gallery.hoangyell.com",
27
27
  "repository": {
28
28
  "type": "git",
29
29
  "url": "https://github.com/HoangYell/hoangyell-gallery.git",
package/src/Gallery.astro CHANGED
@@ -159,6 +159,7 @@ if (resolvedRows <= 1 || galleryItems.length <= 1) {
159
159
  --hy-gallery-control-bg: rgba(255, 255, 255, 0.95);
160
160
  }
161
161
 
162
+ /* OS-level dark preference. */
162
163
  @media (prefers-color-scheme: dark) {
163
164
  .hy-gallery {
164
165
  --hy-gallery-bg: #0f172a;
@@ -170,6 +171,28 @@ if (resolvedRows <= 1 || galleryItems.length <= 1) {
170
171
  }
171
172
  }
172
173
 
174
+ /* Explicit light theme on any ancestor wins over OS preference.
175
+ Supports Tailwind-style `.light` class and `[data-theme="light"]`. */
176
+ :where(.light, [data-theme="light"]) .hy-gallery {
177
+ --hy-gallery-bg: #f8fafc;
178
+ --hy-gallery-overlay-bg: rgba(255, 255, 255, 0.7);
179
+ --hy-gallery-accent: #2563eb;
180
+ --hy-gallery-border: #e2e8f0;
181
+ --hy-gallery-text: #334155;
182
+ --hy-gallery-control-bg: rgba(255, 255, 255, 0.95);
183
+ }
184
+
185
+ /* Explicit dark theme on any ancestor wins over OS preference.
186
+ Supports Tailwind-style `.dark` class and `[data-theme="dark"]`. */
187
+ :where(.dark, [data-theme="dark"]) .hy-gallery {
188
+ --hy-gallery-bg: #0f172a;
189
+ --hy-gallery-overlay-bg: rgba(2, 6, 23, 0.8);
190
+ --hy-gallery-accent: #60a5fa;
191
+ --hy-gallery-border: #334155;
192
+ --hy-gallery-text: #e2e8f0;
193
+ --hy-gallery-control-bg: rgba(30, 41, 59, 0.95);
194
+ }
195
+
173
196
  .hy-gallery {
174
197
  display: flex;
175
198
  flex-direction: column;