Skip to content

Commit

Permalink
Add outlines for high contrast mode (#2456)
Browse files Browse the repository at this point in the history
  • Loading branch information
TylerJDev committed Dec 15, 2023
1 parent 37304f6 commit fd38b17
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/fair-kings-retire.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@primer/view-components': patch
---

Adds visible outlines to `Overlay` and `Tooltip` in high contrast mode.
6 changes: 6 additions & 0 deletions app/components/primer/alpha/overlay.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,9 @@ anchored-position.not-anchored::backdrop, dialog::backdrop {
background-color: var(--overlay-backdrop-bgColor, var(--color-neutral-muted));
}

@media (forced-colors: active) {
.Overlay {
outline: solid 1px transparent;
}
}

10 changes: 10 additions & 0 deletions app/components/primer/alpha/tool_tip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,16 @@ class ToolTipElement extends HTMLElement {
margin-top: -6px;
border-right-color: var(--bgColor-emphasis, var(--color-neutral-emphasis-plus));
}
@media (forced-colors: active) {
:host {
outline: solid 1px transparent;
}
:host:before {
display: none;
}
}
`
}

Expand Down

0 comments on commit fd38b17

Please sign in to comment.