Skip to content

Enhance documentation and add support for dark mode in the theme selector#5332

Merged
gautamdsheth merged 3 commits into
devfrom
fix/docs-docfx-nightmode
May 30, 2026
Merged

Enhance documentation and add support for dark mode in the theme selector#5332
gautamdsheth merged 3 commits into
devfrom
fix/docs-docfx-nightmode

Conversation

@gautamdsheth
Copy link
Copy Markdown
Collaborator

Type

  • Bug Fix
  • New Feature
  • Sample

Related Issues?

Improve theme and docs

What is in this Pull Request ?

Use modern theme , support light/dark mode and better local builds

Copilot AI review requested due to automatic review settings May 30, 2026 20:25
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Switches the documentation site from the custom material template to DocFX's built-in modern template plus a small PnP overlay (templates/pnp-modern) that defines light/dark theme variables and enables the theme selector. Also restructures Build-Site.ps1 to support local builds with parameterized paths and a -SkipPublish switch, and rewrites the local-build documentation accordingly.

Changes:

  • Replace templates/material with modern + new templates/pnp-modern (CSS variables for light/dark themes; JS sets defaultTheme: "auto").
  • Refactor Build-Site.ps1 to compute paths from $PSScriptRoot, add -PublishPath/-SkipPublish params, wrap work in try/finally to restore the cmdlets index template and clean generated files.
  • Rewrite buildingdocumentation.md to direct contributors to run Build-Site.ps1 -SkipPublish instead of docfx build directly, and refresh the verification checklist for the modern template assets.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
pages/templates/pnp-modern/public/main.js New JS asset setting the modern template's default theme to auto.
pages/templates/pnp-modern/public/main.css New PnP brand overrides for the modern template, with light and dark data-bs-theme variants.
pages/templates/material/styles/docfx.js Tightens search keyword highlight guard (q !== nullq) in the legacy template that is no longer referenced by docfx.json.
pages/docfx.json Switches template stack from default + templates/material to default + modern + templates/pnp-modern; adds _appName.
pages/Build-Site.ps1 Parameterizes paths, adds publish controls, wraps generation in try/finally with cleanup, and uses Join-Path throughout.
pages/articles/buildingdocumentation.md Updates local-build instructions to use Build-Site.ps1 -SkipPublish and refreshes the verification checklist for modern-template assets.

function highlightKeywords() {
var q = url('?q');
if (q !== null) {
if (q) {
Comment thread pages/Build-Site.ps1
Comment on lines +249 to +252
if (![string]::IsNullOrWhiteSpace($PublishPath)) {
Write-Host "Copying generated site to $PublishPath"
Copy-Item -Path (Join-Path $SitePath "*") -Destination $PublishPath -Force -Recurse
}
@gautamdsheth gautamdsheth merged commit bfb686b into dev May 30, 2026
2 checks passed
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.

2 participants