Theme Builder and Theme JSON Internals
This example is the Module 1 console gets one theme file,
Themes/AdaptiveOps.theme, created as a full copy of the Bootstrap-4 base theme and edited in the lesson's order:
named colour and font tokens first (brandPrimary, brandAccent, surface, surfaceAlt, textMain, textMuted,
danger, warning, success, focusFrame; fonts default, heading, mono), then the button, panel (caption
bar), tab, grid header, invalid editor and tooltip appearances from those tokens, then an action-button
appearance that inherits from button and overrides only default, hovered and pressed. Default.json names the
theme, the status label reports Application.Theme.Name, the Save command gets its look through AppearanceKey, and
no BackColor, ForeColor or Font is left in the project.
Run it
cd "LearnWisej-Samples/Theming and Responsive Layouts Course/Module 2/AdaptiveOps"
dotnet run -f net10.0 --urls http://localhost:5502
Then open http://localhost:5502 (or open AdaptiveOps.slnx in Visual Studio and press F5).
What to try
- Startup: the console renders on AdaptiveOps (page on
surfaceAlt, white cards with 6 px corners, abrandPrimarycaption bar on the details card); the status bar readsTheme: AdaptiveOpsandWidth: N px. - Save (details panel) is an
action-button: hover it (#1F4A92), hold the mouse (#183B75and a 1 px shift), Tab to it (the shared focus ring frombutton). Its tooltip uses thetooltip/atomappearance. - Clear the Title (or Owner) and press Save: the server rejects the ticket and the editor enters the theme's
invalidstate (dangerborder, the message in the error tooltip); the status label says why. - Grid header:
table-header-cellonsurfaceAltwithtextMutedtext; the sorted column's text isbrandAccent. - Apply theme re-reads
Application.Theme.Nameinto the status label and re-appliesaction-buttonto Save. - Theme not found: change
"theme"inDefault.jsonto a name with no file inThemes/and restart: the status label readsTheme "AdaptiveOps" was not found in the Themes folder; running "…".
Where things live
AdaptiveOps/
├─ Themes/AdaptiveOps.theme the custom theme: full Bootstrap-4 copy + the Module 2 edits (Content, copied to bin/)
├─ Default.json "theme": "AdaptiveOps"
├─ Web.config Wisej.DefaultTheme = AdaptiveOps
├─ MainPage.Designer.cs the docked shell: AppearanceKey / States only, no BackColor, ForeColor or Font
├─ MainPage.cs ApplyTheme() (Load + btnApplyTheme_Click), tickets, Save with the invalid state
├─ Models/ the same ticket data as every module
└─ docs/
├─ ThemeNotes.md file structure, tokens, appearances, inheritance and state-order decisions
├─ ThemeBuilderSteps.md the Theme Builder session (tree, property grid, preview, live update, Last Clicked)
└─ ThemePreviewScreenshots.md the preview and browser screenshots the learner takes, and what each must show