Skip to content

Fix docs showing theme variables from 11.7 for 11.6 docs#2491

Open
matyasf wants to merge 1 commit intomasterfrom
fix_docs_old_themes
Open

Fix docs showing theme variables from 11.7 for 11.6 docs#2491
matyasf wants to merge 1 commit intomasterfrom
fix_docs_old_themes

Conversation

@matyasf
Copy link
Copy Markdown
Collaborator

@matyasf matyasf commented Mar 27, 2026

Docs was showing the new, rewritten Canvas and Canvas high contrast theme variables in the v11_6 pages. This fix makes it show the correct version.

To test:
Check the theme variables and compare it with the new theme changelog. e.g. Mask should show different values in 11.6 and 11.7 docs.

fixes INSTUI-4977

Docs was showing the new, rewritten Canvas and Canvas high contrast theme variables in the v11_6
pages. This fix makes it show the correct version.

To test:
Check the theme variables and compare it with the new theme changelog.
e.g. Mask should show different values in 11.6 and 11.7 docs.

fixes INSTUI-4977
@matyasf matyasf self-assigned this Mar 27, 2026
@matyasf matyasf changed the title refactor: fix docs showing theme variables from 11.7 for 11.6 docs Fix docs showing theme variables from 11.7 for 11.6 docs Mar 27, 2026
@github-actions
Copy link
Copy Markdown

PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://instructure.design/pr-preview/pr-2491/

Built to branch gh-pages at 2026-03-27 14:12 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

componentVersion?: string
}

export const AppContext = createContext<AppContextType>({
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needed to be extracted otherwise React would throw a circular dependency error

Comment on lines +91 to +93
const isLegacyTheme = this.context?.componentVersion == 'v11_6'
// new theme
if (!isLegacyTheme) {
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the actual fix. Previously we were always showing the new theme if it was avaialbe. Now we show the old theme if we're showing v11.6 components

@matyasf matyasf requested review from balzss and git-nandor March 27, 2026 14:19
Copy link
Copy Markdown
Contributor

@balzss balzss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks and works fine

class App extends Component<AppProps, AppState> {
static allowedProps = allowedProps
static contextType = AppContext
declare context: React.ContextType<typeof AppContext>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick, no need to change it but I'd just import ContextType instead of React. Imports are treeshaken so it doesn't actually matter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants