[go: nahoru, domu]

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

[mediaqueries] Add inactive window MQ #5040

Open
fantasai opened this issue May 5, 2020 · 2 comments
Open

[mediaqueries] Add inactive window MQ #5040

fantasai opened this issue May 5, 2020 · 2 comments

Comments

@fantasai
Copy link
Collaborator
fantasai commented May 5, 2020

We briefly discussed the possibility of adding a "window is inactive" mediaquery in https://lists.w3.org/Archives/Public/www-style/2020Jan/0002.html (follow up in https://lists.w3.org/Archives/Public/www-style/2020Jan/0006.html) for issue 4579. It wouldn't solve the original issue, but might still be useful as a declarative way to access this info, which as @AmeliaBR points out is already available via JS.

Questions:

  • What should the MQ be called?
  • What's the value space? Seems like we need values representing visibility and has-focus states.
@frivoal
Copy link
Collaborator
frivoal commented May 6, 2020

Having focus vs not seems binary, and should be easy.

Visibility seems a lot trickier. In addition to be fully visible or fully hidden, a window may be

  • partially obscured
  • partially transparent
  • (partially) obscured by something transparent
  • minimized (in the task bar, the dock, whatever), but with a live miniature preview
  • Zoomed out by your window manager to let you pick between multiple windows, like in macOS's exposé or smartphone's task switchers

@AmeliaBR
Copy link
Contributor

Visibility seems a lot trickier.

The media query should match the Page Visibility API: “The Document is at least partially visible on at least one screen.”

That spec doesn't go into details like preview thumbnails. IMO, they should count as “visible” if they are being live updated, but I think they are often static screenshots of the last rendered version, in which case a current visibility state isn't really relevant.

The primary use case for having this in CSS is for delaying animations/transitions until the page is actually being drawn.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants