-
-
Notifications
You must be signed in to change notification settings - Fork 0
Add dialog demo #4
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
Conversation
jamesnw
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this looks good overall. I few minor things, and I think I'd like a Miriam/Stacy review as well!
src/dialog/index.html
Outdated
| <article> | ||
| <h1 data-heading="main"> Popping up with the <code>dialog</code> element</h1> | ||
| <section> | ||
| <h2 data-heading> Some Jumping Spiders |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we do a play on JS = jumping spiders?
"Less JS (JavaScript), More JS (Jumping Spiders)"
"Vanilla JS (but the JS is Jumping spiders)"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about "Less JS, More Jumping Spiders"? 🕷️🕸️
✅ Deploy Preview for oddbaseline ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
src/dialog/style.css
Outdated
| transition: | ||
| opacity var(--transition-timing-slower) ease-in, | ||
| overlay var(--transition-timing-fast) linear, | ||
| display var(--transition-timing-fast) linear, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the out animation is jumpy because display animates so much faster than opacity. Consider making display one of the slowest, so it doesn't disappear before it's done fading?
|
@mirisuzanne I think I addressed all of the nesting and animation issues, so this is ready for another quick look. |
mirisuzanne
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dvdherron looks great. There's a little linting that I think would clean up the code some, but isn't essential and we've never discussed any 'rules for nesting' or anything. To me it reads better if the nested stuff can be ordered:
- properties
- variants (like
&[open]) - descendants (like
[data-heading])
Since there's specificity differences at play, I think that can all be reordered safely without impacting the cascade at all.
|
@mirisuzanne thanks. cleaned this up in 4fb757a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had a few minor quibbles, but also the exit animations are only working in Chrome. In Firefox, it just disappears, but in Safari, it seems that overlay flips to none immediately, which puts the dialog in the bottom layer's flow, below the credits, causing the page to scroll down.
I suspect this is due to overlay animation not being supported in Safari or Firefox. I think we need to mention that in the article, and also see if we can find a way for the Safari experience not to jump so much. Potentially put the exit animation in a @supports block? Although I'm not sure how to feature detect this.
Also, I think whatever we find here will also need to be applied to the Dropdown demo.
Doing a feature check for I'll add notes for adding this note to the article and add the same approach to the dropdown if we think this works. |
I think this works, but I'm wondering if there's an easy way to only disable the exit animation, or if it has to be all or nothing like this? |
@jamesnw Ok, I figured out how to test on the latest version of Safari and was finally able to see what was happening. Shortening the |
jamesnw
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Transitions look good!
Change into the src/dialog directory
Run npx http-server .
Open http://localhost:8080/