W3C home > Mailing lists > Public > www-style@w3.org > November 2016

Re: [css3-selectors]: Proposal: :in-view() selector for better visibility control

From: Oriol _ <oriol-bugzilla@hotmail.com>
Date: Wed, 30 Nov 2016 19:42:23 +0000
To: Alexander Shpack <shadowkin@gmail.com>, "www-style@w3.org" <www-style@w3.org>
Message-ID: <VI1PR09MB0029E0D7D651B1A7D98F2C42978C0@VI1PR09MB0029.eurprd09.prod.outlook.com>
I think this could produce infinite loops:


:in-view(all) {

  display: none;



- Oriol


Hi folks!

It would be perfect if we get the next pseudo class: :in-view() with a different parameters
:in-view(all) - selected node is 100% visible in viewport
:in-view(partial) - selected node is partially visible in viewport
:in-view(none) - selected node is outside of viewport

And inverted logic using :not()
:not(:in-view(all)) - synonym of :in-view(none)
:not(:in-view(partial)) - selected node is partially INvisible in viewport
:not(:in-view(none)) - synonym of :in-view(all)

Real cases are the next.
If I have some absolutely positioned popup blocks inside of relative positioned ones, sometimes it fall out from viewport due relative block position I would like to return that block into a viewport again. Now I have to use JS.

Other one is sticky behavior. I can hide something or change the position just using :in-view(partial) selector. I don't need position: sticky anymore :)

So, what do you think about it?

Received on Wednesday, 30 November 2016 19:43:00 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:09:05 UTC