Skip to content

Conversation

@JeremyKuhne
Copy link
Member

  • Update manifest to opt into PMV2 scaling (eliminates blurring on high DPI)
  • Tweak dark mode scroll bars to be more visible
  • Update to C# 11
  • Update most packages to latest (updating Azure packages cause runtime failures)
  • Add Packages.props to the solution folder for simplicity
  • Hook various XAML files to pick up the theme
  • Set the WebView2 control preferred color scheme to match
  • Remove outdated Internet Explorer related tag
  • Change html sources to indicate that they support light and dark themes
  • Generate html with theme specific code

I generally used two root entries :root[data-theme="light"] as it enables doing things like letting you flip the theme with a button (say to print). I didn't put that in this PR as I'm not super clear on the value.

For future reference, here is how you would do that:

  <style>
@media print {
  .no-print {
    display: none !important;
  }
  </style>

<button type="button" class="no-print" onclick="toggleTheme()">🌗 Toggle Theme</button>

  <script>
    // Simple theme toggle script: switches the data-theme attribute on <html>
    function toggleTheme() {
      const root = document.documentElement;
      const newTheme = root.getAttribute('data-theme') === 'light' ? 'dark' : 'light';
      root.setAttribute('data-theme', newTheme);
    }
  </script>

I gave up on updating the Azure packages as they cause PerfView to fail at runtime. Would require a bit more time.

- Update manifest to opt into PMV2 scaling (eliminates blurring on high DPI)
- Tweak dark mode scroll bars to be more visible
- Update to C# 11
- Update most packages to latest (updating Azure packages cause runtime failures)
- Add Packages.props to the solution folder for simplicity
- Hook various XAML files to pick up the theme
- Set the WebView2 control preferred color scheme to match
- Remove outdated Internet Explorer related <meta> tag
- Change html sources to indicate that they support light and dark themes
- Generate html with theme specific code

I generally used two root entries `:root[data-theme="light"]` as it enables doing things like letting you flip the theme with a button (say to print). I didn't put that in this PR as I'm not super clear on the value.

For future reference, here is how you would do that:

```html
  <style>
@media print {
  .no-print {
    display: none !important;
  }
  </style>

<button type="button" class="no-print" onclick="toggleTheme()">🌗 Toggle Theme</button>

  <script>
    // Simple theme toggle script: switches the data-theme attribute on <html>
    function toggleTheme() {
      const root = document.documentElement;
      const newTheme = root.getAttribute('data-theme') === 'light' ? 'dark' : 'light';
      root.setAttribute('data-theme', newTheme);
    }
  </script>
```

I gave up on updating the Azure packages as they cause PerfView to fail at runtime. Would require a bit more time.
@JeremyKuhne
Copy link
Member Author

image

@JeremyKuhne
Copy link
Member Author

image

@JeremyKuhne
Copy link
Member Author

There might be value in looking at using a more current "fluent" style library to theme. There are still a lot of rough edges. :)

Copy link
Member

@brianrob brianrob left a comment

Choose a reason for hiding this comment

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

@JeremyKuhne, these are some great changes. Thank you! A couple of follow-ups below.

@brianrob brianrob merged commit 3c3485e into microsoft:main Aug 6, 2025
5 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