Skip to content

docs(emotion,docs-app): add theming guide - #2732

Open
matyasf wants to merge 1 commit into
masterfrom
INSTUI-5198-theming-guide
Open

matyasf wants to merge 1 commit into
masterfrom
INSTUI-5198-theming-guide

Conversation

@matyasf

@matyasf matyasf commented Sep 28, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Add a Theming guide that showcases a small, but complex example how to apply an InstUI theme properly

Test Plan

  • Open Guides → Theming in the docs app and check that the themed login page example renders
  • Switch the example between light, dark, canvas, and canvas high contrast; the background, card, divider, and InstUI components should all follow the theme
  • Check that the "theming" link in Getting Started → Further reading opens the new page

Fixes INSTUI-5198

🤖 Generated with Claude Code

@matyasf matyasf self-assigned this Sep 28, 2026
@matyasf
matyasf requested review from HerrTopi and joyenjoyer and removed request for joyenjoyer September 28, 2026 14:25
@github-actions

github-actions Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1

QR code for preview link

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

Built to branch gh-pages at 2026-09-28 15:28 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@github-actions

Copy link
Copy Markdown
Contributor

Visual regression report

Cypress suite: ✅ Passing

Visual diff: ✅ No changes.

Status Count
Unchanged 99
Changed 0
New 0
Removed 0

Accessibility (axe): ✅ No violations.

📊 View full report — click a screenshot's ⚠ badge to see each violation boxed on the image, with the offending element named and contrast failures shown as color swatches.

Baselines come from the visual-baselines branch. They refresh on every merge to master. The Cypress suite line covers the a11y and console-error assertions — a ❌ there means the suite found real issues even if the visual diff is clean.

github-actions Bot pushed a commit that referenced this pull request Sep 28, 2026
Comment thread docs/guides/theming.md
| Canvas (legacy) | `import { canvas } from '@instructure/ui-themes'` | `v11_6` and `v11_7+` |
| Canvas high contrast (legacy) | `import { canvasHighContrast } from '@instructure/ui-themes'` | `v11_6` and `v11_7+` |

v11.6 components fall back to the `canvas` theme when one tried to apply the `light` and `dark` themes. See [Component versioning](/#component-versioning) for details.

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 correct @HerrTopi ?

@matyasf
matyasf force-pushed the INSTUI-5198-theming-guide branch from d5d112a to ce080f2 Compare September 28, 2026 14:47
github-actions Bot pushed a commit that referenced this pull request Sep 28, 2026
Add a guide on applying themes and styling custom layouts with the theme. Expose
useComputedTheme to live doc examples and note in its JSDoc that sharedTokens is the only
part with a stable shape across themes.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@matyasf
matyasf force-pushed the INSTUI-5198-theming-guide branch from ce080f2 to f7848de Compare September 28, 2026 15:24
Comment on lines +84 to +108
// declared variables, do not import these, e.g. const XYZ
const declared = new Set(
[...code.matchAll(LOCAL_DECLARATION_PATTERN)].map((m) => m[1])
[...code.matchAll(/\b(?:class|function|const|let)\s+([A-Z]\w*)/g)].map(
(m) => m[1]
)
)
// icons: IconXYZLine, IconXYZSolid, XYZInstUIIcon
// contexts: XYZContext
// JSX tags: <XYZ>
const used = new Set(
[...code.matchAll(USED_NAME_PATTERN)].map((m) => m[1] ?? m[2])
[
...code.matchAll(
/<([A-Z]\w+)|\b(Icon[A-Z]\w*(?:Line|Solid)|[A-Z]\w*InstUIIcon|[A-Z]\w+Context)\b/g
)
].map((m) => m[1] ?? m[2])
)
// light, dark, canvasHighContrast, canvas, useComputedTheme
const specials = new Set(
[
...code.matchAll(
/(?<!['"])\b(light|dark|canvasHighContrast|canvas|useComputedTheme)\b(?!['"])/g
)
].map((m) => m[1] ?? m[2])
)
return [...used].filter((name) => !declared.has(name))
return [...used, ...specials].filter((name) => !declared.has(name))

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.

cleaned up this code a bit, and now it imports light|dark|canvasHighContrast|canvas|useComputedTheme when its in the examples

github-actions Bot pushed a commit that referenced this pull request Sep 28, 2026
@matyasf
matyasf requested a review from adamlobler September 29, 2026 08:52

This branch has not been deployed

No deployments
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.

1 participant