Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overlay component #1998

Merged
merged 31 commits into from May 10, 2022
Merged

Overlay component #1998

merged 31 commits into from May 10, 2022

Conversation

bolonio
Copy link
Contributor

@bolonio bolonio commented Mar 25, 2022

What are you trying to accomplish?

We, the @github/accessibility team, have been working on a new Dialog Component that should become a Primer Component.

Note: minor class changes will need to happen when the PVC Dialog is upstreamed into PVC. Alternatively, Dialog will use the new Overlay component under the hood (private API).

This PR includes:

  • New Dialog Component
    • Styles for the : src/overlay/overlay.scss
    • Storybook story: docs/src/stories/components/Dialog/Dialog.stories.jsx
    • Documentation: docs/content/components/dialog.md (removed from nav to promote PVC)

The implementation of the New Experimental Dialog Component can be found in this PR:

What has changed?

BEFORE

A screenshot of the original delete discussion dialog

AFTER

A screenshot of the new experimental delete discussion dialog

Are additional changes needed?

No, this PR should be ok to ship as is. 🚢

@changeset-bot
Copy link

changeset-bot bot commented Mar 25, 2022

🦋 Changeset detected

Latest commit: ea44985

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@primer/css Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@bolonio bolonio self-assigned this Mar 25, 2022
@langermank langermank marked this pull request as ready for review March 30, 2022 17:05
@langermank langermank requested a review from a team as a code owner March 30, 2022 17:05
@langermank langermank marked this pull request as draft March 30, 2022 17:06
@bolonio
Copy link
Contributor Author

bolonio commented Apr 4, 2022

Added to the Primer Issue: https://github.com/github/primer/issues/426

@bolonio bolonio changed the title Styles for the new Dialog Component New Experimental Dialog Component Apr 4, 2022
src/overlay/overlay.scss Outdated Show resolved Hide resolved
docs/content/components/dialog.md Outdated Show resolved Hide resolved
src/overlay/overlay.scss Show resolved Hide resolved
src/overlay/overlay.scss Show resolved Hide resolved
@langermank langermank temporarily deployed to github-pages April 26, 2022 22:33 Inactive
@langermank langermank temporarily deployed to github-pages April 26, 2022 23:17 Inactive
overflow-y: auto;
padding-top: 0;
overflow-y: scroll;
scrollbar-width: thin;
Copy link
Contributor

@vdepizzol vdepizzol Apr 27, 2022

Choose a reason for hiding this comment

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

fancy! :chef-kiss:

@langermank langermank temporarily deployed to github-pages April 27, 2022 01:15 Inactive
Copy link
Contributor

@simurai simurai left a comment

Choose a reason for hiding this comment

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

Added a few comment. Not sure if anything is blocking since this component is only meant for PVC and making changes later should not be too much of a hassle. 🤞

src/overlay/overlay.scss Outdated Show resolved Hide resolved
src/overlay/overlay.scss Show resolved Hide resolved
src/overlay/overlay.scss Show resolved Hide resolved
src/overlay/overlay.scss Outdated Show resolved Hide resolved
src/overlay/overlay.scss Outdated Show resolved Hide resolved
top: 4px;
}

@mixin Overlay-backdrop() {
Copy link
Contributor

@simurai simurai Apr 27, 2022

Choose a reason for hiding this comment

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

Should we use a .Overlay-backdrop class instead of a mixin? We would have to add two classes when used:

- class="Overlay-backdrop--center"
+ class="Overlay-backdrop Overlay-backdrop--center"

but we should be able to save some file size because these "base styles" would not get repeated for every variation.

Copy link
Contributor

Choose a reason for hiding this comment

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

I see what you're saying.. it's a little more complicated though because we also have Overlay-backdrop--transparent(). So instead of overriding styles in each backdrop class .Overlay-backdrop--anchor I extracted it into a mixin 🤔 I think if I went back to classes, we would have to include more conditional logic within each class which might add more complexity to the selectors.

I think this CSS is a little more complex than I would like it to be (using mixins so extensively) but the responsive behavior is complex 😂

left: 0;
z-index: 999;
display: flex;
background-color: var(--color-neutral-muted);
Copy link
Contributor

Choose a reason for hiding this comment

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

This is more a design question, but there is also the --color-primer-canvas-backdrop that is meant for the backdrop of modal/dialogs. It is darker and less transparent. So not sure if --color-neutral-muted is intentionally used here.

Copy link
Contributor

Choose a reason for hiding this comment

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

It is intentionally used here.. I either pulled this from @vdepizzol's designs or from the PRC implementation. Perhaps we will need to update the primitive to match this new design decision (or deprecate that token and make a new one.)

Copy link
Contributor

@simurai simurai May 2, 2022

Choose a reason for hiding this comment

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

Ok, yeah.. currently --color-primer-canvas-backdrop gets used for details-overlay-dark and the "old" SelectMenu when in narrow. Which we might wanna keep as is, for now.

IMO, the --color-neutral-muted used as a backdrop feels a bit too transparent and doesn't direct the attention enough to the dialog because you can still see the rest of the the UI. Anyways, something we can reconsider later too. I still have to see it in a live example.

Co-authored-by: simurai <simurai@github.com>
@langermank langermank temporarily deployed to github-pages April 27, 2022 13:48 Inactive
@langermank langermank temporarily deployed to github-pages April 27, 2022 14:15 Inactive
@langermank langermank temporarily deployed to github-pages April 27, 2022 14:29 Inactive
@langermank langermank temporarily deployed to github-pages May 4, 2022 19:44 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants