@sofidevo/astro-dynamic-header 5.0.6 → 5.0.7

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/package.json +1 -1
  2. package/src/Header.astro +13 -17
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sofidevo/astro-dynamic-header",
3
- "version": "5.0.6",
3
+ "version": "5.0.7",
4
4
  "description": "A dynamic Astro header component that switches between floating and fullscreen styles",
5
5
  "type": "module",
6
6
  "main": "./src/index.ts",
package/src/Header.astro CHANGED
@@ -34,7 +34,7 @@ export interface Props {
34
34
  * <Header preset="dark" />
35
35
  * ```
36
36
  */
37
- preset?: "light" | "dark" | "auto" | "none" ;
37
+ preset?: "light" | "dark" | "auto" | "none";
38
38
 
39
39
  /**
40
40
  * Navigation links, home link, and fine-grained classes for the desktop
@@ -79,7 +79,6 @@ export interface Props {
79
79
  */
80
80
  classNames?: HeaderClassNames;
81
81
  headerBg?: string;
82
-
83
82
  }
84
83
 
85
84
  const {
@@ -114,15 +113,13 @@ const {
114
113
  menu__link__class,
115
114
  } = navigation;
116
115
 
117
-
118
-
119
116
  let forcedClass = "";
120
117
  if (preset !== "none") {
121
118
  forcedClass = `header--force-${preset}`;
122
119
  }
123
120
  ---
124
121
 
125
- <style >
122
+ <style>
126
123
  @layer theme, base, components, utilities;
127
124
  </style>
128
125
 
@@ -202,8 +199,11 @@ if (preset !== "none") {
202
199
  @layer theme, base, components, utilities;
203
200
 
204
201
  @layer components {
205
- .header {
202
+ :root {
203
+ --header-bg: rgba(255, 255, 255, 0.748);
204
+ }
206
205
 
206
+ .header {
207
207
  --bg-color: var(--l-bg, rgba(255, 255, 255, 0.748));
208
208
  --bg-color-opaque: var(--l-bg-opaque, rgba(255, 255, 255, 0.748));
209
209
  --text-color: var(--l-text, #1a1a1a);
@@ -221,7 +221,7 @@ if (preset !== "none") {
221
221
  transition:
222
222
  background-color 0.3s ease,
223
223
  color 0.3s ease;
224
- z-index: 200;
224
+ z-index: 200;
225
225
 
226
226
  @media (width < 768px) {
227
227
  align-self: flex-end;
@@ -232,14 +232,14 @@ if (preset !== "none") {
232
232
 
233
233
  /* Automatic dark mode detection via root class */
234
234
  :root.dark .header:not(.header--force-light):not(.header--force-dark) {
235
- --bg-color: var(--d-bg, rgba(0, 0, 0, 0.823));
235
+ --header-bg: rgba(0, 0, 0, 0.823);
236
+ --bg-color: var(--bg, rgba(0, 0, 0, 0.823));
236
237
  --bg-color-opaque: var(--d-bg-opaque, #0d0d0d);
237
238
  --text-color: var(--d-text, #ffffff);
238
239
  --accent-color: var(--d-accent, #00ffff);
239
240
  --backdrop-blur: var(--d-blur, blur(20px));
240
241
  }
241
242
 
242
-
243
243
  /* Forced themes: higher specificity than .header, no !important needed */
244
244
  .header.header--force-dark {
245
245
  --bg-color: var(--d-bg, rgba(0, 0, 0, 0.823));
@@ -251,25 +251,21 @@ if (preset !== "none") {
251
251
  }
252
252
 
253
253
  .header.header--force-light {
254
- --bg-color: var(--l-bg, rgba(255, 255, 255, 0.748));
254
+ --bg-color: var(--l-bg, rgba(255, 255, 255, 0.748));
255
255
  --bg-color-opaque: var(--l-bg-opaque, rgb(255, 255, 255));
256
256
  --text-color: var(--l-text, #1a1a1a);
257
257
  --accent-color: var(--l-accent, #3e1c71);
258
258
  --backdrop-blur: var(--l-blur, blur(30px));
259
259
  background-color: var(--bg-color);
260
260
  }
261
- .dark{
262
-
263
- --bg-color: var(--l-bg, rgba(255, 255, 255, 0.748));
264
-
261
+ .dark {
265
262
  }
266
263
  .header.header--force-auto {
267
- --bg-color: var(--l-bg);
268
264
  --bg-color-opaque: var(--l-bg-opaque, rgba(255, 255, 255, 0.748));
269
265
  --text-color: var(--l-text, #1a1a1a);
270
266
  --accent-color: var(--l-accent, #3e1c71);
271
267
  --backdrop-blur: var(--l-blur, blur(20px));
272
- background-color: var(--bg-color);
268
+ background-color: var(--header-bg);
273
269
  }
274
270
 
275
271
  .header__container {
@@ -307,7 +303,7 @@ if (preset !== "none") {
307
303
 
308
304
  .header--fullscreen {
309
305
  border-radius: 0;
310
- padding:0.6rem 1em ;
306
+ padding: 0.6rem 1em;
311
307
 
312
308
  @media (width < 768px) {
313
309
  max-width: 100%;