Enlarge WPF Gallery nav chevron to meet 3:1 non-text contrast#780
Open
amarinov-msft wants to merge 1 commit into
Open
Enlarge WPF Gallery nav chevron to meet 3:1 non-text contrast#780amarinov-msft wants to merge 1 commit into
amarinov-msft wants to merge 1 commit into
Conversation
Author
|
@microsoft-github-policy-service agree company="Microsoft" |
e63a44f to
12aae6e
Compare
12aae6e to
d466cb9
Compare
The Fluent nav TreeView expand/collapse chevron renders as a thin FontSize-10 glyph whose anti-aliased strokes only reach ~2.6:1 against the nav background, below the WCAG/MAS 1.4.11 3:1 non-text contrast minimum. The glyph size is baked into the sealed theme template via a StaticResource and cannot be overridden through application resources, so the chevron FontSize is enlarged on each realized nav container in code-behind, rendering the full stroke at ~3.9:1 in every theme. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
d466cb9 to
435f447
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes an accessibility issue in the WPF Gallery navigation pane. The expand/collapse chevron on
TreeViewItemrendered at only ~2.6:1 contrast against the pane background, below the 3:1 minimum required by MAS 1.4.11 - Non-text Contrast and is flagged by Accessibility Insights. The default Fluent theme draws the chevron with a very thinFontSize10 glyph whose anti-aliased strokes never reach full color. The chevron's size is baked into the sealed theme template viaStaticResource, so it cannot be corrected with app-level resource overrides.Change
Sample Applications/WPFGallery/MainWindow.xaml.csEnlarge the navigation chevron glyph from
FontSize10 toFontSize12 in code-behind. The fix walks each realized navTreeViewItem(including children generated lazily on expand) and sets the chevron'sFontSizedirectly. The glyph keeps the inherited primary text brush (no color or weight change), so the heavier strokes now render at full color while preserving the original subtle appearance.Result
The chevron now renders #797979 on #F3F3F3 = 3.92:1, up from ~2.6:1, passing the 3:1 requirement. The Accessibility Insights Non-Text Contrast check passes, and the chevron remains a subtle gray rather than a heavy black.
Testing
System,LightandDarkthemeMicrosoft Reviewers: Open in CodeFlow