@astronox/core 0.4.15 → 0.4.16

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astronox/core",
3
- "version": "0.4.15",
3
+ "version": "0.4.16",
4
4
  "description": "Reusable Astro components, patterns, styles, and infrastructure for AstroNox sites.",
5
5
  "license": "MIT",
6
6
  "keywords": [
@@ -4,7 +4,9 @@ const noop = (): void => undefined;
4
4
  export function initScrollToTop(control: HTMLButtonElement): () => void {
5
5
  if (control.getAttribute(initializedAttribute) === 'true') return noop;
6
6
 
7
- const scrollRoot = document.scrollingElement;
7
+ const scrollRoot = document.querySelector<HTMLElement>(
8
+ '[data-site-scroll-root]',
9
+ );
8
10
  if (!scrollRoot) return noop;
9
11
 
10
12
  control.setAttribute(initializedAttribute, 'true');
@@ -15,16 +17,16 @@ export function initScrollToTop(control: HTMLButtonElement): () => void {
15
17
  };
16
18
 
17
19
  const scrollToTop = (): void => {
18
- window.scrollTo({ top: 0, behavior: 'auto' });
20
+ scrollRoot.scrollTo({ top: 0, behavior: 'auto' });
19
21
  };
20
22
 
21
- window.addEventListener('scroll', sync, { passive: true });
23
+ scrollRoot.addEventListener('scroll', sync, { passive: true });
22
24
  document.addEventListener('fullscreenchange', sync);
23
25
  control.addEventListener('click', scrollToTop);
24
26
  sync();
25
27
 
26
28
  return () => {
27
- window.removeEventListener('scroll', sync);
29
+ scrollRoot.removeEventListener('scroll', sync);
28
30
  document.removeEventListener('fullscreenchange', sync);
29
31
  control.removeEventListener('click', scrollToTop);
30
32
  control.removeAttribute(initializedAttribute);
@@ -65,7 +65,7 @@ const resolvedTone = tone ?? dataTone;
65
65
  <div class="site-shell">
66
66
  <slot name="skip-link" />
67
67
  <slot name="header" />
68
- <div class="site-viewport" data-site-viewport>
68
+ <div class="site-viewport" data-site-scroll-root data-site-viewport>
69
69
  <main id="content" class="site-main" tabindex="-1">
70
70
  <div class="site-main__content">
71
71
  {
@@ -503,11 +503,11 @@ export function initCombobox(root: HTMLElement): () => void {
503
503
  const target = event.target;
504
504
  if (target instanceof Node && panel.contains(target)) return;
505
505
 
506
- const siteViewport = document.querySelector<HTMLElement>(
507
- '[data-site-viewport]',
506
+ const siteScrollRoot = document.querySelector<HTMLElement>(
507
+ '[data-site-scroll-root]',
508
508
  );
509
509
  const isSiteScroll =
510
- target === siteViewport || target === document || target === window;
510
+ target === siteScrollRoot || target === document || target === window;
511
511
  if (isSiteScroll && window.matchMedia(compactViewportQuery).matches) {
512
512
  close();
513
513
  blurFocusedDescendant();
@@ -1,8 +1,4 @@
1
- html:has(.modal[open]) {
2
- overflow: hidden;
3
- }
4
-
5
- html:has(.modal[open]) [data-site-viewport] {
1
+ html:has(.modal[open]) [data-site-scroll-root] {
6
2
  overflow-y: hidden;
7
3
  }
8
4
 
@@ -44,42 +44,46 @@
44
44
 
45
45
  html {
46
46
  min-width: 320px;
47
+ height: 100%;
47
48
  min-height: 100%;
48
- scroll-padding-block-start: var(--nox-site-header-responsive-height);
49
- scrollbar-gutter: stable;
49
+ overflow: hidden;
50
50
  background: var(--nox-page-background);
51
51
  color: var(--nox-text);
52
52
  font-family: var(--nox-font-body);
53
53
  }
54
54
 
55
55
  body {
56
+ height: 100%;
56
57
  min-height: 100%;
57
58
  margin: 0;
59
+ overflow: hidden;
58
60
  background: var(--nox-page-background);
59
61
  }
60
62
 
61
- @media (hover: hover) and (pointer: fine) {
62
- body {
63
- border-inline-end: var(--nox-border-width) solid var(--nox-border);
64
- }
65
- }
66
-
67
63
  .site-shell {
68
64
  display: grid;
69
65
  width: 100%;
66
+ height: 100vh;
70
67
  min-height: 100vh;
71
68
  grid-template-rows: auto minmax(0, 1fr);
72
- overflow-x: clip;
73
- overflow-y: visible;
69
+ overflow: hidden;
74
70
  background: var(--nox-page-background);
75
71
  }
76
72
 
77
- @supports (min-height: 100svh) {
73
+ @supports (height: 100svh) {
78
74
  .site-shell {
75
+ height: 100svh;
79
76
  min-height: 100svh;
80
77
  }
81
78
  }
82
79
 
80
+ @media (width >= 48rem) {
81
+ .site-shell {
82
+ height: 100vh;
83
+ min-height: 100vh;
84
+ }
85
+ }
86
+
83
87
  a {
84
88
  color: var(--nox-content-link-color);
85
89
  font-weight: var(--nox-content-link-font-weight);
@@ -129,13 +133,14 @@ p {
129
133
 
130
134
  .site-viewport {
131
135
  --site-content-gap: var(--nox-space-5);
132
- --nox-sticky-viewport-offset: var(--nox-site-header-responsive-height);
133
136
 
134
137
  min-width: 0;
135
138
  min-height: 0;
136
- overflow: visible;
139
+ overflow-x: hidden;
140
+ overflow-y: auto;
141
+ scrollbar-gutter: stable;
137
142
  background: var(--nox-page-background);
138
- overscroll-behavior-y: auto;
143
+ overscroll-behavior-y: contain;
139
144
  }
140
145
 
141
146
  .site-main {