Skip to content

Conversation

@GaneshPatil7517
Copy link
Contributor

This PR adds optional dark mode support to the Apache Shiro documentation site.

Changes include:

  • CSS variables for theme colors
  • Dark theme overrides for Bootstrap components and Asciidoctor content
  • Theme toggle button in the header navigation
  • Persisted user preference using localStorage

The implementation is lightweight, does not introduce new dependencies,
and follows existing site structure.

Tested locally using Maven site generation.

Closes #266

Copilot AI review requested due to automatic review settings January 19, 2026 08:38
@GaneshPatil7517
Copy link
Contributor Author

Apache.Shiro.mp4

Copy link
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

This PR adds optional dark mode support to the Apache Shiro documentation website and introduces a new troubleshooting FAQ page. The dark mode implementation is lightweight and follows modern web practices with CSS variables, localStorage persistence, and smooth transitions.

Changes:

  • Added theme toggle functionality with CSS variables for theming
  • Created comprehensive troubleshooting & FAQ documentation page
  • Updated navigation menus to include troubleshooting link

Reviewed changes

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

Show a summary per file
File Description
src/site/assets/js/theme.js Implements theme toggle logic with localStorage persistence and icon updates
src/site/assets/css/base.css Defines CSS variables for light/dark themes and comprehensive dark mode overrides for Bootstrap and Asciidoctor components
src/site/templates/menu.ftl Adds theme toggle button to navigation and troubleshooting link to Community dropdown
src/site/templates/header.ftl Loads theme.js early in head to prevent theme flash on page load
src/site/content/troubleshooting.adoc New comprehensive FAQ page covering common Shiro issues with practical solutions
src/site/content/support.adoc Adds link to new troubleshooting page in support resources list

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@lprimak
Copy link
Contributor

lprimak commented Jan 25, 2026

Hi, Ganesh!
Thank you once again for your contribution.

I deployed the staging website here: https://shiro.staged.apache.org

However, the dark mode toggle doesn't seem to work.
Never mind, I had to clear the cache and it works.

However, in dark mode, much text (announcements / blogs) for example is unreadable.

Can you please take a look?
Thank you!

@GaneshPatil7517
Copy link
Contributor Author

hey @lprimak its working....

Apache.mp4

@lprimak
Copy link
Contributor

lprimak commented Jan 27, 2026

Yes I realized this when cleared the cache. But a lot of text is not readable in dark mode as it's lacking contrast.

Can you please take a look at that one?

@GaneshPatil7517
Copy link
Contributor Author

Hi @lprimak, I've fixed the contrast issues for announcements/blogs text in dark mode. The following elements now have proper contrast:

News cards on home page
Blog archive listings
Blog post content
Pagination controls
Please take another look when you get a chance. Thanks!

@lprimak
Copy link
Contributor

lprimak commented Jan 30, 2026

Looks much better, but still has one issue that I can see...

Code samples still have bad contrast.
For example, https://shiro.staged.apache.org/migration-guide.html - "Jakarta EE Native Support"

Can you take a look?

@GaneshPatil7517
Copy link
Contributor Author

Looks much better, but still has one issue that I can see...

Code samples still have bad contrast. For example, https://shiro.staged.apache.org/migration-guide.html - "Jakarta EE Native Support"

Can you take a look?

yahh sure....

- Add Highlight.js syntax token colors for dark mode
- Style keywords (purple), strings (green), comments (gray), numbers (orange)
- Add class names (yellow), attributes (blue), tags (cyan) styling
- Fix Asciidoctor listing blocks for dark mode

Addresses review feedback about code samples having bad contrast.
@GaneshPatil7517
Copy link
Contributor Author

Hi @lprimak, I've pushed a fix for the code sample contrast issue. Added complete Highlight.js syntax highlighting colors for dark mode - keywords, strings, comments, numbers, class names, and XML tags all now have proper contrast. Please check the migration guide page again. Thanks!

@lprimak lprimak merged commit 410eb25 into apache:main Jan 31, 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.

Add dark mode theme support to documentation website

2 participants