Skip to content

Commit

Permalink
tweak popover css (#2055)
Browse files Browse the repository at this point in the history
Co-authored-by: Cameron Dutro <[email protected]>
  • Loading branch information
keithamus and camertron authored Jun 7, 2023
1 parent bc40f58 commit 5911ff9
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 7 deletions.
5 changes: 5 additions & 0 deletions .changeset/angry-files-leave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@primer/view-components': patch
---

Tweak Overlay CSS to account for cases where the browser supports :open, :popover-open, both, or neither.
5 changes: 2 additions & 3 deletions .github/workflows/preview-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,8 @@ jobs:

- name: Generate static files
run: |
bundle exec rake utilities:build
bundle exec rake docs:build
bundle exec rake static:dump
bundle exec rake utilities:build docs:build static:dump
echo -e "/* autoprefixer: off */\n$(cat docs/static/primer_view_components.css)" > docs/static/primer_view_components.css
- name: Build
run: npm run build:docs:preview
Expand Down
18 changes: 14 additions & 4 deletions app/components/primer/alpha/overlay.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,23 @@
padding: 0;
position: absolute;
min-width: 192px;
inset: auto;
}

/* stylelint-disable-next-line selector-pseudo-class-no-unknown */
.Overlay[popover]:not(:popover-open) {
.Overlay[popover]:not(.\:popover-open) {
display: none;
}

anchored-position {
display: block;
/* This reverts the declaration above for native popover, where `:popover-open` is supported */
@supports selector(:popover-open) {
.Overlay[popover]:not(.\:popover-open) {
display: revert;
}
}

/* This reverts the declaration above for native popover, where `:open` is supported (Chrome 113, Safari TP) */
@supports selector(:open) {
.Overlay[popover]:not(.\:popover-open) {
display: revert;
}
}

0 comments on commit 5911ff9

Please sign in to comment.