File tree Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' @primer/react ' : patch
3+ ---
4+
5+ Update TreeView hover and focus styles to work in Windows High Contrast Mode
Original file line number Diff line number Diff line change @@ -216,7 +216,11 @@ const Item: React.FC<TreeViewItemProps> = ({
216216 borderRadius : 2 ,
217217 cursor : 'pointer' ,
218218 '&:hover' : {
219- backgroundColor : 'actionListItem.default.hoverBg'
219+ backgroundColor : 'actionListItem.default.hoverBg' ,
220+ '@media (forced-colors: active)' : {
221+ outline : '2px solid transparent' ,
222+ outlineOffset : - 2
223+ }
220224 } ,
221225 '@media (pointer: coarse)' : {
222226 '--toggle-width' : '1.5rem' , // 24px
@@ -227,7 +231,11 @@ const Item: React.FC<TreeViewItemProps> = ({
227231 // are unnecessarily specific to work around that styled-components bug.
228232 // Reference issue: https://github.com/styled-components/styled-components/issues/3265
229233 [ `[role=tree][aria-activedescendant="${ itemId } "]:focus-visible #${ itemId } > &:is(div)` ] : {
230- boxShadow : ( theme : Theme ) => `inset 0 0 0 2px ${ theme . colors . accent . emphasis } `
234+ boxShadow : ( theme : Theme ) => `inset 0 0 0 2px ${ theme . colors . accent . emphasis } ` ,
235+ '@media (forced-colors: active)' : {
236+ outline : '2px solid SelectedItem' ,
237+ outlineOffset : - 2
238+ }
231239 } ,
232240 '[role=treeitem][aria-current=true] > &:is(div)' : {
233241 bg : 'actionListItem.default.selectedBg' ,
You can’t perform that action at this time.
0 commit comments