igniteui-astro-components 0.0.8 → 0.0.10

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 (30) hide show
  1. package/package.json +1 -1
  2. package/src/components/DocsBreadcrumb/DocsBreadcrumb.astro +3 -3
  3. package/src/components/DocsBreadcrumb/DocsBreadcrumb.scss +12 -3
  4. package/src/components/DocsSidebar/DocsSidebar.astro +5 -1
  5. package/src/components/DocsSidebar/DocsSidebar.scss +27 -40
  6. package/src/components/DocsSidebar/SidebarFilterInput.astro +3 -4
  7. package/src/components/DocsSidebar/SidebarFilterInput.scss +2 -3
  8. package/src/components/DocsSubHeader/DocsSubHeader.astro +16 -7
  9. package/src/components/DocsSubHeader/DocsSubHeader.scss +32 -35
  10. package/src/components/DocsToc/DocsToc.astro +10 -5
  11. package/src/components/DocsToc/DocsToc.scss +10 -11
  12. package/src/components/DocsTree/docs-tree.scss +16 -9
  13. package/src/components/MobileTocToggle/MobileTocToggle.astro +96 -0
  14. package/src/components/MobileTocToggle/MobileTocToggle.scss +74 -0
  15. package/src/components/Search/Search.astro +13 -9
  16. package/src/components/Search/Search.scss +13 -0
  17. package/src/components/SearchAdvanced/SearchAdvanced.astro +17 -3
  18. package/src/components/SearchAdvanced/SearchAdvanced.scss +170 -139
  19. package/src/components/mdx/DocsAside/DocsAside.scss +11 -28
  20. package/src/components/mdx/Sample/Sample.scss +3 -3
  21. package/src/layouts/DocsLayout/DocsLayout.astro +24 -6
  22. package/src/layouts/DocsLayout/DocsLayout.scss +241 -81
  23. package/src/styles/global/_breakpoints.scss +15 -37
  24. package/src/styles/global/_component-themes.scss +8 -27
  25. package/src/styles/global/_markdown.scss +514 -452
  26. package/src/styles/global/_palette.scss +8 -7
  27. package/src/styles/global/_search-shared.scss +63 -64
  28. package/src/styles/global/_type-scale.scss +2 -2
  29. package/src/styles/global/_variables.scss +8 -21
  30. package/src/styles/theme.scss +26 -8
@@ -0,0 +1,74 @@
1
+ @use 'igniteui-theming/sass/typography' as *;
2
+
3
+ @layer components {
4
+
5
+ // Hidden by default. DocsLayout.scss reveals it on mobile-horizontal viewports.
6
+ .mobile-toc {
7
+ display: none;
8
+ }
9
+
10
+ .mobile-toc__trigger {
11
+ display: flex;
12
+ align-items: center;
13
+ width: 100%;
14
+ gap: rem(8px);
15
+ padding-inline: var(--igd-padding-md);
16
+ padding-block: rem(12px);
17
+ background: transparent;
18
+ border: none;
19
+ cursor: pointer;
20
+ color: light-dark(var(--ig-gray-700), var(--ig-gray-300));
21
+
22
+ &:focus-visible {
23
+ outline: none;
24
+ box-shadow: inset 0 0 0 1px var(--igd-accent);
25
+ }
26
+
27
+ &[aria-expanded='true'] .mobile-toc__chevron {
28
+ transform: rotate(180deg);
29
+ }
30
+ }
31
+
32
+ .mobile-toc__label {
33
+ @include type-style('body-2') { margin: 0; };
34
+ font-weight: 600;
35
+ flex-shrink: 0;
36
+ }
37
+
38
+ .mobile-toc__active {
39
+ @include type-style('body-2') { margin: 0; };
40
+ color: var(--igd-accent);
41
+ overflow: hidden;
42
+ text-overflow: ellipsis;
43
+ white-space: nowrap;
44
+ flex: 1;
45
+ text-align: start;
46
+
47
+ &:empty { display: none; }
48
+
49
+ &::before { content: '— '; }
50
+ }
51
+
52
+ .mobile-toc__chevron {
53
+ flex-shrink: 0;
54
+ margin-inline-start: auto;
55
+ transition: transform 200ms ease;
56
+ }
57
+
58
+ .mobile-toc__dropdown {
59
+ overflow: hidden;
60
+ max-height: 0;
61
+ transition: max-height 300ms ease;
62
+
63
+ &[aria-hidden='false'] {
64
+ max-height: 75dvh;
65
+ overflow-y: auto;
66
+ }
67
+
68
+ nav {
69
+ padding-inline: var(--igd-padding-md);
70
+ padding-block-end: rem(16px);
71
+ }
72
+ }
73
+
74
+ }
@@ -17,8 +17,6 @@ import './Search.scss';
17
17
  class="search-trigger"
18
18
  aria-label="Search documentation"
19
19
  title="Search (Ctrl+K)"
20
- commandfor="search-dialog"
21
- command="show-modal"
22
20
  >
23
21
  <igc-icon name="search" collection="docs" aria-hidden="true"></igc-icon>
24
22
  <span class="search-trigger__label">Search</span>
@@ -33,6 +31,17 @@ import './Search.scss';
33
31
 
34
32
  <dialog id="search-dialog" class="search-dialog" aria-label="Search">
35
33
  <div class="igd-search-shell">
34
+ <div class="igd-search-mobile-bar">
35
+ <button
36
+ type="button"
37
+ class="search-trigger search-close"
38
+ aria-label="Close search"
39
+ commandfor="search-dialog"
40
+ command="close"
41
+ >
42
+ <igc-icon name="close" collection="docs" aria-hidden="true"></igc-icon>
43
+ </button>
44
+ </div>
36
45
  <div class="igd-search-status" aria-live="polite"></div>
37
46
  <div id="search-pagefind"></div>
38
47
  </div>
@@ -117,13 +126,8 @@ import './Search.scss';
117
126
  }
118
127
  updateSearchHint();
119
128
 
120
- // Declarative show-modal via commandfor fires a `command` event on the dialog —
121
- // use it to load page find and focus the input.
122
- document.addEventListener('command', async (e: Event) => {
123
- const ce = e as CommandEvent;
124
- if (ce.target instanceof HTMLDialogElement && ce.target.id === 'search-dialog') {
125
- await loadAndMountPagefind();
126
- }
129
+ document.getElementById('search-trigger')?.addEventListener('click', () => {
130
+ openSearch();
127
131
  });
128
132
 
129
133
  // Keyboard shortcut
@@ -1,5 +1,8 @@
1
+ @use 'igniteui-theming' as *;
1
2
  @use '../../styles/global/search-shared' as *;
2
3
 
4
+ @layer components {
5
+
3
6
  .search-dialog {
4
7
  @include search-dialog-base-styles;
5
8
  background: var(--igd-layout-sections-bg);
@@ -16,3 +19,13 @@
16
19
  @include search-dialog-backdrop-open;
17
20
  }
18
21
  }
22
+
23
+ // Mobile-only bar — DocsLayout.scss flips display:flex on mobile.
24
+ .igd-search-mobile-bar {
25
+ display: none;
26
+ justify-content: flex-end;
27
+ border-bottom: rem(1px) solid var(--igd-app-outline-color);
28
+ min-height: rem(48px);
29
+ }
30
+
31
+ }
@@ -114,7 +114,7 @@ const resolvedIndexUrl = indexUrl ?? `${basePath}api-search-index/manifest.json`
114
114
  <igc-dialog aria-label={placeholder} class="igd-search-dialog" hide-default-action close-on-outside-click>
115
115
  <div class="igd-search-shell">
116
116
  <header class="igd-search-header">
117
- <igc-select slot="prefix" class="igd-search-scope" outlined aria-label="Search scope" value="current">
117
+ <igc-select placement="bottom-start" distance="17" slot="prefix" class="igd-search-scope" outlined aria-label="Search scope" value="current">
118
118
  {platformIcon && <igc-icon id="search-scope-trigger-icon" name={platformIcon} collection="docs" slot="prefix" aria-hidden="true"></igc-icon>}
119
119
  <igc-select-item value="current">
120
120
  <span data-scope-label>Current package</span>
@@ -132,11 +132,22 @@ const resolvedIndexUrl = indexUrl ?? `${basePath}api-search-index/manifest.json`
132
132
  outlined
133
133
  aria-label={placeholder}
134
134
  >
135
- <igc-icon name="search" collection="docs" slot="prefix" aria-hidden="true"></igc-icon>
135
+ <igc-icon class="igd-search-icon" name="search" collection="docs" slot="prefix" aria-hidden="true"></igc-icon>
136
136
  <igc-icon-button slot="suffix" class="igd-search-clear" variant="flat" type="button" aria-label="Clear search" name="clear" collection="docs" hidden></igc-icon-button>
137
137
  </igc-input>
138
+
139
+ <button
140
+ type="button"
141
+ data-close-modal
142
+ class="search-trigger search-close"
143
+ aria-label="Close search"
144
+ >
145
+ <igc-icon name="close" collection="docs" aria-hidden="true"></igc-icon>
146
+ </button>
138
147
  </header>
139
148
 
149
+ <igc-divider></igc-divider>
150
+
140
151
  <div class="igd-search-status" aria-live="polite"></div>
141
152
 
142
153
  <igc-tabs class="igd-search-tabs" activation="manual" hidden></igc-tabs>
@@ -280,6 +291,7 @@ const resolvedIndexUrl = indexUrl ?? `${basePath}api-search-index/manifest.json`
280
291
  }
281
292
 
282
293
  const openBtn = this.querySelector<HTMLButtonElement>('button[data-open-modal]')!;
294
+ const closeBtn = this.querySelector<HTMLButtonElement>('button[data-close-modal]')!;
283
295
  this.dialog = this.querySelector<IgcDialogComponent>('igc-dialog')!;
284
296
  this.input = this.querySelector<IgcInputComponent>('igc-input.igd-search-input')!;
285
297
  this.clearBtn = this.querySelector<IgcIconButtonComponent>('.igd-search-clear')!;
@@ -341,6 +353,8 @@ const resolvedIndexUrl = indexUrl ?? `${basePath}api-search-index/manifest.json`
341
353
  openBtn.addEventListener('click', open);
342
354
  openBtn.disabled = false;
343
355
 
356
+ closeBtn.addEventListener('click', () => this.closeModal());
357
+
344
358
  this.dialog.addEventListener('igcClosed', () => {
345
359
  document.body.toggleAttribute('data-search-modal-open', false);
346
360
  });
@@ -758,7 +772,7 @@ const resolvedIndexUrl = indexUrl ?? `${basePath}api-search-index/manifest.json`
758
772
  allContent.push(
759
773
  `<span class="igd-search-category-header">${escapeHtml(cat.label)}</span>` +
760
774
  `<igc-list class="igd-search-results">${items}</igc-list>` +
761
- moreBtn
775
+ moreBtn + `<igc-divider></igc-divider>`
762
776
  );
763
777
  }
764
778
  tabsHtml.push(
@@ -1,94 +1,93 @@
1
1
  @use 'igniteui-theming' as *;
2
2
  @use '../../styles/global/search-shared' as *;
3
3
 
4
- api-search-advanced { display: contents; }
5
-
6
- .igd-search-dialog {
7
- --border-radius: 0;
8
- --background: var(--igd-layout-sections-bg);
9
- --transition-duration: 150ms;
10
- border: none;
11
-
12
- &::part(base) {
13
- @include search-dialog-base-styles;
14
-
15
- &:focus-visible {
16
- outline: none;
4
+ @layer components {
5
+ api-search-advanced { display: contents; }
6
+
7
+ .igd-search-dialog {
8
+ --border-radius: 0;
9
+ --background: var(--igd-layout-sections-bg);
10
+ --transition-duration: 150ms;
11
+
12
+ border: none;
13
+
14
+ &::part(base) {
15
+ @include search-dialog-base-styles;
16
+
17
+ &:focus-visible {
18
+ outline: none;
19
+ }
17
20
  }
18
- }
19
-
20
- &::part(content) {
21
- padding: 0;
22
- display: flex;
23
- flex-direction: column;
24
- height: 100%;
25
- }
26
-
27
- &::part(backdrop) {
28
- @include search-dialog-backdrop;
29
- }
30
-
31
- &[open]::part(backdrop) {
32
- @include search-dialog-backdrop-open;
33
- }
34
-
35
- igc-input {
36
- height: 100%;
37
-
38
- &::part(container) {
39
- border: 0;
21
+
22
+ &::part(content) {
40
23
  padding: 0;
24
+ display: flex;
25
+ flex-direction: column;
41
26
  height: 100%;
42
27
  }
28
+
29
+ &::part(backdrop) {
30
+ @include search-dialog-backdrop;
31
+ }
32
+
33
+ &[open]::part(backdrop) {
34
+ @include search-dialog-backdrop-open;
35
+ }
36
+
37
+ igc-input {
38
+ height: 100%;
39
+ }
40
+
41
+ igc-input::part(container) {
42
+ border: 0;
43
+ height: 100%;
44
+ padding: 0 rem(16px) !important;
45
+ border-block-end: none !important;
46
+
47
+ &:focus-within {
48
+ box-shadow:
49
+ 0 0 0 1px var(--igd-accent),
50
+ inset 0 1px 0 var(--igd-accent),
51
+ inset 0 -1px 0 var(--igd-accent),
52
+ inset -1px 0 0 var(--igd-accent);
53
+ }
54
+ }
43
55
  }
44
-
45
- igc-divider {
46
- margin-inline: rem(16px);
56
+
57
+ .search-trigger {
58
+ color: light-dark(var(--ig-gray-600), var(--ig-gray-400));
47
59
  }
48
- }
49
-
50
- // TODO BUG IN THE TAB COMPONENT
51
- igc-tabs::part(inner) {
52
- flex-grow: 1;
53
- }
54
-
55
- // TODO Log issue in the component this is not suppose to be affected by the ig-typography
56
- igc-tab::part(content) {
57
- @include type-style('subtitle-1') {
58
- margin: 0;
60
+
61
+ .igd-search-icon {
62
+ color: light-dark(var(--ig-gray-900), var(--ig-gray-500));
59
63
  }
60
- }
61
-
62
- .igd-search-tabs {
63
- --item-background: var(--igd-layout-sections-bg);
64
64
 
65
- flex: 1 1 auto;
66
- min-height: 0;
67
- overflow: hidden;
68
- display: flex;
69
- flex-direction: column;
65
+ // TODO BUG IN THE TAB COMPONENT
66
+ igc-tabs::part(inner) {
67
+ flex-grow: 1;
68
+
69
+ }
70
70
 
71
- &::part(base) {
72
- display: flex;
73
- flex-direction: column;
74
- height: 100%;
75
- min-height: 0;
71
+ igc-tabs {
72
+ igc-divider {
73
+ margin-block: rem(26px);
74
+
75
+ &:last-of-type {
76
+ display: none;
77
+ }
78
+ }
79
+ }
80
+
81
+ // TODO Log issue in the component this is not suppose to be affected by the ig-typography
82
+ igc-tab::part(content) {
83
+ @include type-style('subtitle-1') {
84
+ margin: 0;
85
+ }
76
86
  }
77
87
 
78
- igc-tab {
79
- --item-text-color: light-dark(var(--ig-gray-900), var(--ig-gray-700));
88
+ .igd-search-tabs {
80
89
  --item-background: var(--igd-layout-sections-bg);
81
- --item-hover-background: var(--igd-layout-sections-bg);
82
- --item-hover-color: var(--igd-accent);
83
- --item-active-color: var(--igd-accent);
84
- --item-active-hover-color: var(--igd-accent);
85
- --item-icon-color: var(--igd-accent);
86
- --item-active-icon-color: var(--igd-accent);
87
- --item-active-hover-icon-color: var(--igd-accent);
88
- --item-hover-icon-color: var(--igd-accent);
89
- --item-active-background: var(--igd-layout-sections-bg);
90
- --item-active-hover-background: var(--igd-layout-sections-bg);
91
- --indicator-color: var(--igd-accent);
90
+ --indicator-color: transparent;
92
91
  --button-color: var(--igd-accent);
93
92
  --button-hover-color: var(--igd-accent);
94
93
  --button-background: var(--igd-layout-sections-bg);
@@ -96,82 +95,114 @@ igc-tab::part(content) {
96
95
  --border-color: var(--igd-layout-sections-bg);
97
96
  --border-color--hover: var(--igd-layout-sections-bg);
98
97
  --border-radius: 0;
98
+
99
+ flex: 1 1 auto;
100
+ min-height: 0;
101
+ overflow: hidden;
102
+ display: flex;
103
+ flex-direction: column;
104
+
105
+ &::part(base) {
106
+ display: flex;
107
+ flex-direction: column;
108
+ height: 100%;
109
+ min-height: 0;
110
+ }
111
+
112
+ igc-tab {
113
+ --item-text-color: light-dark(var(--ig-gray-900), var(--ig-gray-700));
114
+ --item-background: var(--igd-layout-sections-bg);
115
+ --item-hover-background: var(--igd-layout-sections-bg);
116
+ --item-hover-color: var(--igd-accent);
117
+ --item-active-color: var(--igd-accent);
118
+ --item-active-hover-color: var(--igd-accent);
119
+ --item-icon-color: var(--igd-accent);
120
+ --item-active-icon-color: var(--igd-accent);
121
+ --item-active-hover-icon-color: var(--igd-accent);
122
+ --item-hover-icon-color: var(--igd-accent);
123
+ --item-active-background: var(--igd-layout-sections-bg);
124
+ --item-active-hover-background: var(--igd-layout-sections-bg);
125
+ }
126
+
127
+ igc-tab::part(content),
128
+ igc-tab::part(base) {
129
+ @include type-style('overline') {
130
+ margin: 0;
131
+ }
132
+ }
133
+
134
+ igc-tab::part(tab-body) {
135
+ overflow-y: auto;
136
+ flex: 1 1 auto;
137
+ min-height: 0;
138
+ padding-block: rem(26px);
139
+ }
99
140
  }
100
141
 
101
- igc-tab::part(content),
102
- igc-tab::part(base) {
103
- @include type-style('overline') {
104
- margin: 0;
105
- }
142
+ .igd-search-header {
143
+ display: flex;
144
+ min-height: rem(75px);
145
+ padding-inline-start: rem(16px);
106
146
  }
107
147
 
108
- igc-tab::part(tab-body) {
109
- overflow-y: auto;
110
- flex: 1 1 auto;
111
- min-height: 0;
112
- padding: rem(26px);
148
+ .igd-search-scope {
149
+ flex-shrink: 0;
150
+ align-self: center;
113
151
  }
114
- }
115
-
116
- .igd-search-header {
117
- display: flex;
118
- border-bottom: rem(1px) solid var(--igd-app-outline-color);
119
- min-height: rem(75px);
120
- padding-inline: rem(16px);
121
- }
122
-
123
- .igd-search-scope {
124
- flex-shrink: 0;
125
- align-self: center;
126
- }
127
-
128
- .igd-search-input {
129
- --input-prefix-background: transparent;
130
- --input-prefix-background--focused: transparent;
131
- --input-prefix-background--filled: transparent;
132
152
 
133
- --input-suffix-background: transparent;
134
- --input-suffix-background--focused: transparent;
135
- --input-suffix-background--filled: transparent;
153
+ .igd-search-input {
154
+ --input-prefix-background: transparent;
155
+ --input-prefix-background--focused: transparent;
156
+ --input-prefix-background--filled: transparent;
136
157
 
137
- width: 100%;
158
+ --input-suffix-background: transparent;
159
+ --input-suffix-background--focused: transparent;
160
+ --input-suffix-background--filled: transparent;
138
161
 
139
- &::part(input) {
140
- @include type-style('body-2') {
141
- margin: 0;
162
+ width: 100%;
163
+ min-width: 0;
164
+ flex: 1 1 auto;
165
+
166
+ &::part(input) {
167
+ @include type-style('body-2') {
168
+ margin: 0;
169
+ }
142
170
  }
143
171
  }
144
- }
145
-
146
- .igd-search-clear {
147
- --foreground: light-dark(var(--ig-gray-900), var(--ig-gray-900));
148
- --backgroind-hover: transparent;
149
- --hover-foreground: var(--igd-accent);
150
- --focus-hover-foreground: var(--igd-accent);
151
- --focus-foreground: var(--igd-accent);
152
- --active-foreground: var(--igd-accent);
153
- --shadow-color: transparent;
154
- --background: transparent;
155
- --hover-background: transparent;
156
- --focus-background: transparent;
157
- --focus-hover-background: transparent;
158
- --active-background: transparent;
159
- --border-color: transparent;
160
- --focus-border-color: red;
161
- --border-radius: 0;
162
-
163
- &::part(base) {
164
- &::after {
165
- display: none;
172
+
173
+ .igd-search-clear {
174
+ --foreground: light-dark(var(--ig-gray-900), var(--ig-gray-900));
175
+ --backgroind-hover: transparent;
176
+ --hover-foreground: var(--igd-accent);
177
+ --focus-hover-foreground: var(--igd-accent);
178
+ --focus-foreground: var(--igd-accent);
179
+ --active-foreground: var(--igd-accent);
180
+ --shadow-color: transparent;
181
+ --background: transparent;
182
+ --hover-background: transparent;
183
+ --focus-background: transparent;
184
+ --focus-hover-background: transparent;
185
+ --active-background: transparent;
186
+ --border-color: transparent;
187
+ --border-radius: 0;
188
+
189
+ &::part(base) {
190
+ &::after {
191
+ display: none;
192
+ }
193
+ }
194
+
195
+ &::part(focused) {
196
+ --foreground: var(--igd-accent);
166
197
  }
167
198
  }
168
199
 
169
- &::part(focused) {
170
- --foreground: var(--igd-accent);
200
+ .igd-search-tab-count {
201
+ color: light-dark(var(--ig-gray-500), var(--ig-gray-300));
202
+ }
203
+
204
+ igc-divider {
205
+ --color: light-dark(var(--ig-gray-400), var(--ig-gray-300));
171
206
  }
172
- }
173
-
174
- .igd-search-tab-count {
175
- color: light-dark(var(--ig-gray-500), var(--ig-gray-300));
176
207
  }
177
208
 
@@ -21,10 +21,6 @@ blockquote {
21
21
  padding: var(--igd-aside-padding);
22
22
  border-radius: var(--igd-aside-border-radius);
23
23
  margin-block-end: var(--igd-aside-margin-bottom);
24
-
25
- code {
26
- color: inherit;
27
- }
28
24
  }
29
25
 
30
26
  .igd-aside__title {
@@ -58,10 +54,6 @@ blockquote {
58
54
  .igd-aside__content {
59
55
  color: var(--igd-aside-info-content);
60
56
  }
61
-
62
- code {
63
- background: var(--igd-aside-info-code-background);
64
- }
65
57
  }
66
58
 
67
59
  .igd-aside--warning {
@@ -79,10 +71,6 @@ blockquote {
79
71
  .igd-aside__content {
80
72
  color: var(--igd-aside-warning-content);
81
73
  }
82
-
83
- code {
84
- background: var(--igd-aside-warning-code-background);
85
- }
86
74
  }
87
75
 
88
76
  .igd-aside--note {
@@ -100,25 +88,20 @@ blockquote {
100
88
  .igd-aside__content {
101
89
  color: var(--igd-aside-note-content);
102
90
  }
103
-
104
- code {
105
- background: var(--igd-aside-note-code-background);
106
- }
107
91
  }
108
92
 
109
93
  // TYPOGRAPHY STYLES
110
- .ig-typography {
111
- .igd-aside__title {
112
- @include type-style('body-2') {
113
- font-weight: bold;
114
- margin: 0;
115
- };
116
-
117
- }
94
+ .igd-aside__title {
95
+ @include type-style('body-2') {
96
+ font-weight: bold;
97
+ margin: 0;
98
+ };
118
99
 
119
- .igd-aside__content {
120
- @include type-style('detail-1', false) {
121
- margin: 0;
122
- }
100
+ }
101
+
102
+ .igd-aside__content {
103
+ @include type-style('detail-1', false) {
104
+ margin: 0;
123
105
  }
124
106
  }
107
+
@@ -9,7 +9,7 @@ igc-tabs {
9
9
  flex-grow: 1;
10
10
  }
11
11
 
12
- --item-text-color: var(--ig-gray-800);
12
+ --item-text-color: light-dark(var(--ig-gray-900), var(--ig-gray-50));
13
13
  --item-hover-color: var(--igd-accent);
14
14
  --item-background: var(--igd-layout-sections-bg);
15
15
  --item-hover-background: var(--igd-layout-sections-bg);
@@ -20,13 +20,13 @@ igc-tabs {
20
20
  --item-active-hover-background: var(--igd-layout-sections-bg);
21
21
  --indicator-color: var(--igd-accent);
22
22
 
23
- --button-color: var(--ig-gray-800);
23
+ --button-color: light-dark(var(--ig-gray-900), var(--ig-gray-50));
24
24
  --button-hover-color: var(--igd-accent);
25
25
  --button-background: var(--igd-layout-sections-bg);
26
26
  --button-hover-background: var(--igd-layout-sections-bg);
27
27
 
28
28
  .igd-code-view__header-actions {
29
- border-block: rem(1px) solid var(--ig-gray-300);
29
+ border-block: rem(1px) solid light-dark(var(--ig-gray-300), var(--ig-gray-200));
30
30
  }
31
31
 
32
32
  .igd-sample-container {
@@ -61,11 +61,14 @@ type HeadEntry = { tag: string; attrs?: Record<string, string | boolean | undefi
61
61
  <slot name="head" />
62
62
  <ClientRouter />
63
63
  <script is:inline>
64
- // Force light theme on load and after every View Transitions swap
65
- document.documentElement.setAttribute('data-theme', 'light');
66
- document.addEventListener('astro:after-swap', function () {
67
- document.documentElement.setAttribute('data-theme', 'light');
68
- });
64
+ // Restore persisted theme (or default to light) on load and after every View Transitions swap
65
+ function applyStoredTheme() {
66
+ var stored;
67
+ try { stored = localStorage.getItem('docs-theme'); } catch (_) {}
68
+ document.documentElement.setAttribute('data-theme', stored || 'light');
69
+ }
70
+ applyStoredTheme();
71
+ document.addEventListener('astro:after-swap', applyStoredTheme);
69
72
 
70
73
  // Enable smooth scrolling only after the page is fully loaded so the
71
74
  // browser's scroll-position restoration on refresh is instant (no visible
@@ -185,6 +188,21 @@ type HeadEntry = { tag: string; attrs?: Record<string, string | boolean | undefi
185
188
  }
186
189
  document.addEventListener('astro:page-load', initSidebarHeights);
187
190
  initSidebarHeights();
191
+
192
+ // Toggle data-scrolled-y / data-scrolled-x on each .igd-table-wrapper
193
+ // so the sticky header/column can show a double border while scrolled.
194
+ function initTableScrollStates() {
195
+ document.querySelectorAll('.igd-table-wrapper').forEach(function(wrapper) {
196
+ function update() {
197
+ wrapper.toggleAttribute('data-scrolled-y', wrapper.scrollTop > 0);
198
+ wrapper.toggleAttribute('data-scrolled-x', wrapper.scrollLeft > 0);
199
+ }
200
+ wrapper.addEventListener('scroll', update, { passive: true });
201
+ update();
202
+ });
203
+ }
204
+ document.addEventListener('astro:page-load', initTableScrollStates);
205
+ initTableScrollStates();
188
206
  </script>
189
207
  </head>
190
208
  <body>
@@ -200,7 +218,7 @@ type HeadEntry = { tag: string; attrs?: Record<string, string | boolean | undefi
200
218
  the .igd-page-layout not on the body.
201
219
  Any igc component rendered dynamically on body level should have .ig-typography in order to have proper type styles.
202
220
  -->
203
- <div class="igd-page-layout ig-typography">
221
+ <div class="igd-page-layout">
204
222
  <!-- TODO: WE DONT NEED TO CALCULAtE THE IG HEADER HEIGHT ANYMORE - REMOVE IT -->
205
223
  <!-- <DocsSubHeader style={ `--docs-global-nav-height: ${ showGlobalNav ? '4.7rem': '0' }` } data-nav-height-wrapper/> -->
206
224
  <slot name="subheader">