Skip to content

Commit d1ac78c

Browse files
git-nandorclaude
andcommitted
fix(docs-app): version-aware theme-override link and prop-table readability
Point the theme-override guide link at the page matching the selected component version (legacy-theme-overrides for v11_6, new-theme-overrides for v11_7+), fix an "it's" -> "its" typo, and increase the prop-table value font weight from 200 to 600 for legibility. INSTUI-5122 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 350e841 commit d1ac78c

2 files changed

Lines changed: 20 additions & 13 deletions

File tree

packages/__docs__/src/Document/index.tsx

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -166,12 +166,19 @@ class Document extends Component<DocumentProps, DocumentState> {
166166
// the listed tokens may not actually be used by this component.
167167
const isLegacyTheme = this.context?.componentVersion === 'v11_6'
168168
const dotStrippedId = doc.id?.replace(/\./g, '')
169-
const borrowedThemeId =
170-
doc.themeId || doc.componentInstance?.themeId
169+
const borrowedThemeId = doc.themeId || doc.componentInstance?.themeId
171170
const borrowsTokens =
172-
!isLegacyTheme &&
173-
borrowedThemeId &&
174-
borrowedThemeId !== dotStrippedId
171+
!isLegacyTheme && borrowedThemeId && borrowedThemeId !== dotStrippedId
172+
173+
// Point the theme-override guide link at the page that matches the
174+
// selected component version: legacy theming (v11_6) vs. the new
175+
// token-based system (v11_7+).
176+
const themeOverridesPage = isLegacyTheme
177+
? 'legacy-theme-overrides'
178+
: 'new-theme-overrides'
179+
const themeOverridesLabel = isLegacyTheme
180+
? 'Legacy theme overrides'
181+
: 'New theme overrides'
175182

176183
return themeVariables &&
177184
componentTheme &&
@@ -184,9 +191,9 @@ class Document extends Component<DocumentProps, DocumentState> {
184191
{borrowsTokens ? (
185192
<View as="div" margin="0 0 small 0">
186193
Note: <code>{doc.id}</code> shares its theme tokens with{' '}
187-
<code>{borrowedThemeId}</code>, so the table below lists every
188-
token of <code>{borrowedThemeId}</code>. Some of these may not
189-
actually be used by <code>{doc.id}</code>.
194+
<code>{borrowedThemeId}</code>, so the table below lists every token
195+
of <code>{borrowedThemeId}</code>. Some of these may not actually be
196+
used by <code>{doc.id}</code>.
190197
</View>
191198
) : null}
192199
{doc.themePath ? (
@@ -217,7 +224,7 @@ class Document extends Component<DocumentProps, DocumentState> {
217224

218225
<View margin="small 0" display="block">
219226
In case you need to change the appearance of the{' '}
220-
<code>{doc.id}</code> component, you can override it&apos;s
227+
<code>{doc.id}</code> component, you can override its
221228
{doc.themePath
222229
? this.renderThemeLink(doc, ' default theme variables.')
223230
: ' default theme variables.'}
@@ -226,13 +233,13 @@ class Document extends Component<DocumentProps, DocumentState> {
226233
The easiest way to do this is to utilize the{' '}
227234
<code>themeOverride</code> property. See the{' '}
228235
<Link
229-
href="legacy-theme-overrides"
236+
href={themeOverridesPage}
230237
onClick={(e) => {
231238
e.preventDefault()
232-
navigateTo('legacy-theme-overrides')
239+
navigateTo(themeOverridesPage)
233240
}}
234241
>
235-
Legacy theme overrides
242+
{themeOverridesLabel}
236243
</Link>{' '}
237244
guide for more info and alternative methods.
238245
</View>

packages/__docs__/src/Properties/styles.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ const generateStyle = (): PropertiesStyle => {
7676

7777
oneOf: {
7878
label: 'properties__oneOf',
79-
fontWeight: 200,
79+
fontWeight: 600,
8080
fontStyle: 'italic'
8181
},
8282

0 commit comments

Comments
 (0)