-
Notifications
You must be signed in to change notification settings - Fork 73
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
The overlay
CSS property
#777
Comments
As Alan Stearns points out in w3c/csswg-drafts#8730, there's still an open discussion. Sebastian |
w3c/csswg-drafts#8730 was resolved over a year ago, has the position changed or are there plans to work on https://bugzilla.mozilla.org/show_bug.cgi?id=1841456? |
For what it's worth, I think it's weird that this can only be set by transitions and not animations. If we want to keep that behavior, I think we need to specify exactly how that works. For example, if a The fact that only transitions can set it is only defined in non-normative text (although later normative text assumes it to be the case) and the decision to make ignoring transitions in some circumstances undefined is going to cause interop issues:
For example, does pausing such a transition cause it to be ignored? What about seeking it? |
I think as it is currently only used in a very specific context (Popover API, |
I don't doubt the utility of this-I use it myself. I'm just saying this needs spec work/discussion. |
I think I agree with @birtles, this in general feels very narrowly scope. However I think it is well defined how it works in terms of animations unless I'm missing something? In particular, it's defined to be |
Yeah, I think you're right (since animations without an owning element target the animations level of the cascade (ref)). That said, I still think this should be available to regular animations too since my experience with modal dialogs has shown transitions are sometimes not sufficient for outro animations (e.g.). I'm also a bit concerned the deliberately undefined heuristics for ignoring transitions are possibly going to cause interop headaches. It's also not entirely trivial to come up with good heuristics. For example, pausing a transition could cause it to persist its effect forever which could be abused. Ignoring paused transitions, however, would make DevTools less useful since you wouldn't be able to inspect outro animations. Likewise for transitions whose playback rate is slowed down significantly, or transitions that are periodically seek-ed backwards such that they never end. |
Right. Per the spec, nothing prevents you from applying an 'overlay' animation, it's just not going to do anything, due to the property always having a value set in the UA-important cascade origin. Due to the way transitions work, they'll activate and apply even between UA-important value changes, but animations apply between the author and author-important cascade origins, so they'll be ignored.
Without some additional magic, it's not possible to allow something in animations but not in normal properties, so we'd need some extra hand-waving there. Even if we did that, tho, it would still allow authors to keep things in the top layer indefinitely. (The spec uses the 'overlay' value as part of its logic on when to remove something from the top layer.) We'd have to invoke the "kick it out anyway" heuristic more aggressively, whereas currently it's something that should only trigger when you're doing something weird.
It's completely undefined at the moment to allow exploration; we'd be happy to add some actual rules based on implementation experience. The expectation, tho, is that it would only get applied to "weird" cases - a transition lasting many seconds, for example. If your "leaving the top layer" animation is >15s long, you're doing something incredibly weird.
This is a big part of why we haven't specified them in detail yet. For example, I could imagine the heuristic allowing them to persist indefinitely if DevTools is open. |
Yeah, I can see that would be difficult. Maybe it's ok for In my case, I was building a drawer component using a modal |
I'll say I definitely sympathize with the use-case; the fact that you have to coordinate an outro animation with the transition is definitely bad. It's just weighed against the confusion potential of 'overlay' not really doing anything for authors; if it was settable, all they could do would be (a) delay an element from leaving the top layer (by setting All around it's kinda a weird thing, unfortunately. |
Request for Mozilla Position on an Emerging Web Specification
overlay
CSS propertyOther information
The CSS Spec is done. There are additional tie-ins to HTML and fullscreen:
Here is the CSSWG issue: w3c/csswg-drafts#8189
The text was updated successfully, but these errors were encountered: